344 {
347 return false;
348 }
349
350 int bufferSize = 4 * 1024;
351 uint8_t*
buffer = (uint8_t*)av_malloc(bufferSize);
353 return false;
354 }
355
356 fStream = std::move(
stream);
357 fStreamCtx = avio_alloc_context(
buffer, bufferSize, 0, fStream.get(),
359 if (!fStreamCtx) {
362 return false;
363 }
364
365 fFormatCtx = avformat_alloc_context();
366 if (!fFormatCtx) {
368 return false;
369 }
370 fFormatCtx->pb = fStreamCtx;
371
372 int err = avformat_open_input(&fFormatCtx, nullptr, nullptr, nullptr);
373 if (err < 0) {
374 SkDebugf(
"avformat_open_input failed %d\n", err);
375 return false;
376 }
377
378 const AVCodec* codec;
379 fStreamIndex = av_find_best_stream(fFormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, &codec, 0);
380 if (fStreamIndex < 0) {
381 SkDebugf(
"av_find_best_stream failed %d\n", fStreamIndex);
383 return false;
384 }
385
387 fDecoderCtx = avcodec_alloc_context3(codec);
388
389 AVStream* strm = fFormatCtx->streams[fStreamIndex];
390 if ((err = avcodec_parameters_to_context(fDecoderCtx, strm->codecpar)) < 0) {
391 SkDebugf(
"avcodec_parameters_to_context failed %d\n", err);
393 return false;
394 }
395
396 if ((err = avcodec_open2(fDecoderCtx, codec, nullptr)) < 0) {
397 SkDebugf(
"avcodec_open2 failed %d\n", err);
399 return false;
400 }
401
402 fFrame = av_frame_alloc();
404
405 av_init_packet(&fPacket);
406
407 fMode = kProcessing_Mode;
408
409 return true;
410}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static int skstream_read_packet(void *ctx, uint8_t *dstBuffer, int dstSize)
static int64_t skstream_seek_packet(void *ctx, int64_t pos, int whence)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer