Lines Matching defs:avctx

165 static int decklink_setup_video(AVFormatContext *avctx, AVStream *st)
167 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
172 av_log(avctx, AV_LOG_ERROR, "Only one video stream is supported!\n");
178 av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format!"
184 av_log(avctx, AV_LOG_ERROR, "Unsupported codec type!"
191 if (ff_decklink_set_configs(avctx, DIRECTION_OUT) < 0) {
192 av_log(avctx, AV_LOG_ERROR, "Could not set output configuration\n");
195 if (ff_decklink_set_format(avctx, c->width, c->height,
197 av_log(avctx, AV_LOG_ERROR, "Unsupported video size, framerate or field order!"
202 av_log(avctx, AV_LOG_WARNING, "Could not enable video output with VANC! Trying without...\n");
206 av_log(avctx, AV_LOG_ERROR, "Could not enable video output!\n");
225 av_log(avctx, AV_LOG_DEBUG, "output: %s, preroll: %d, frames buffer size: %d\n",
226 avctx->url, ctx->frames_preroll, ctx->frames_buffer);
236 static int decklink_setup_audio(AVFormatContext *avctx, AVStream *st)
238 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
243 av_log(avctx, AV_LOG_ERROR, "Only one audio stream is supported!\n");
247 av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate!"
252 av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels!"
260 av_log(avctx, AV_LOG_ERROR, "Could not enable audio output!\n");
264 av_log(avctx, AV_LOG_ERROR, "Could not begin audio preroll!\n");
277 av_cold int ff_decklink_write_trailer(AVFormatContext *avctx)
279 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
291 ff_decklink_cleanup(avctx);
309 static void construct_cc(AVFormatContext *avctx, struct decklink_ctx *ctx,
331 av_log(avctx, AV_LOG_ERROR, "Invalid framerate specified: %lld/%lld\n",
338 av_log(avctx, AV_LOG_ERROR, "Illegal cc_count received: %d\n", cc_count);
358 av_log(avctx, AV_LOG_ERROR, "Failed converting 708 packet to words\n");
365 av_log(avctx, AV_LOG_ERROR, "VANC line insertion failed\n");
370 static int decklink_construct_vanc(AVFormatContext *avctx, struct decklink_ctx *ctx,
379 construct_cc(avctx, ctx, pkt, &vanc_lines);
384 av_log(avctx, AV_LOG_ERROR, "Failed to create vanc\n");
405 av_log(avctx, AV_LOG_ERROR, "Failed to get VANC line %d: %d", real_line, result);
413 av_log(avctx, AV_LOG_ERROR, "Failed to generate VANC line\n");
421 av_log(avctx, AV_LOG_ERROR, "Failed to set vanc: %d", result);
433 static int decklink_write_video_packet(AVFormatContext *avctx, AVPacket *pkt)
435 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
437 AVStream *st = avctx->streams[pkt->stream_index];
448 av_log(avctx, AV_LOG_ERROR, "Got a frame with invalid pixel format or dimension.\n");
454 av_log(avctx, AV_LOG_ERROR, "Could not clone video frame.\n");
462 av_log(avctx, AV_LOG_ERROR, "Could not clone video frame.\n");
469 if (decklink_construct_vanc(avctx, ctx, pkt, frame))
470 av_log(avctx, AV_LOG_ERROR, "Failed to construct VANC\n");
475 av_log(avctx, AV_LOG_ERROR, "Could not create new frame.\n");
496 av_log(avctx, AV_LOG_ERROR, "Could not schedule video frame."
502 av_log(avctx, AV_LOG_DEBUG, "Buffered video frames: %d.\n", (int) buffered);
504 av_log(avctx, AV_LOG_WARNING, "There are not enough buffered video frames."
509 av_log(avctx, AV_LOG_DEBUG, "Ending audio preroll.\n");
511 av_log(avctx, AV_LOG_ERROR, "Could not end audio preroll!\n");
514 av_log(avctx, AV_LOG_DEBUG, "Starting scheduled playback.\n");
516 av_log(avctx, AV_LOG_ERROR, "Could not start scheduled playback!\n");
525 static int decklink_write_audio_packet(AVFormatContext *avctx, AVPacket *pkt)
527 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
534 av_log(avctx, AV_LOG_WARNING, "There's no buffered audio."
539 av_log(avctx, AV_LOG_ERROR, "Could not schedule audio samples.\n");
548 av_cold int ff_decklink_write_header(AVFormatContext *avctx)
550 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
567 av_log(avctx, AV_LOG_ERROR, "Cannot create VANC library context\n");
575 ff_decklink_list_devices_legacy(avctx, 0, 1);
579 ret = ff_decklink_init_device(avctx, avctx->url);
585 av_log(avctx, AV_LOG_ERROR, "Could not open output device from '%s'\n",
586 avctx->url);
593 ff_decklink_list_formats(avctx);
600 for (n = 0; n < avctx->nb_streams; n++) {
601 AVStream *st = avctx->streams[n];
604 if (decklink_setup_audio(avctx, st))
607 if (decklink_setup_video(avctx, st))
610 av_log(avctx, AV_LOG_ERROR, "Unsupported stream type.\n");
618 ff_decklink_cleanup(avctx);
622 int ff_decklink_write_packet(AVFormatContext *avctx, AVPacket *pkt)
624 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
626 AVStream *st = avctx->streams[pkt->stream_index];
631 return decklink_write_video_packet(avctx, pkt);
633 return decklink_write_audio_packet(avctx, pkt);
638 int ff_decklink_list_output_devices(AVFormatContext *avctx, struct AVDeviceInfoList *device_list)
640 return ff_decklink_list_devices(avctx, device_list, 0, 1);