Lines Matching defs:avctx
331 static uint8_t *vanc_to_cc(AVFormatContext *avctx, uint16_t *buf, size_t words,
340 av_log(avctx, AV_LOG_WARNING, "Invalid CDP header 0x%.2x 0x%.2x\n", cdp[0], cdp[1]);
347 av_log(avctx, AV_LOG_WARNING, "CDP len %d != %zu\n", cdp[2], len);
356 av_log(avctx, AV_LOG_WARNING, "CDP checksum invalid 0x%.4x != 0x%.4x\n", cdp_sum, cdp[len-1]);
362 av_log(avctx, AV_LOG_WARNING, "CDP frame rate invalid (0x%.2x)\n", rate);
367 av_log(avctx, AV_LOG_WARNING, "CDP frame rate invalid (0x%.2x)\n", rate);
372 av_log(avctx, AV_LOG_WARNING, "CDP flags invalid (0x%.2x)\n", cdp[4]);
378 av_log(avctx, AV_LOG_WARNING, "Invalid ccdata_id 0x%.2x\n", cdp[7]);
384 av_log(avctx, AV_LOG_WARNING, "Invalid cc_count 0x%.2x\n", cc_count);
390 av_log(avctx, AV_LOG_WARNING, "Invalid cc_count %d (> %zu)\n", cc_count * 3, len - 13);
395 av_log(avctx, AV_LOG_WARNING, "Invalid footer id 0x%.2x\n", cdp[len-4]);
401 av_log(avctx, AV_LOG_WARNING, "Header 0x%.4x != Footer 0x%.4x\n", hdr, ftr);
407 av_log(avctx, AV_LOG_WARNING, "CC - av_malloc failed for cc_count = %d\n", cc_count);
421 static uint8_t *get_metadata(AVFormatContext *avctx, uint16_t *buf, size_t width,
424 decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
438 av_log(avctx, AV_LOG_WARNING, "Data Count (%d) > data left (%zu)\n",
446 av_log(avctx, AV_LOG_WARNING, "VANC parity or checksum incorrect\n");
454 av_log(avctx, AV_LOG_WARNING, "VANC parity or checksum incorrect\n");
458 data = vanc_to_cc(avctx, buf, width, data_len);
464 av_log(avctx, AV_LOG_DEBUG, "Unknown meta data DID = 0x%.2x SDID = 0x%.2x\n",
474 static void avpacket_queue_init(AVFormatContext *avctx, AVPacketQueue *q)
476 struct decklink_cctx *ctx = (struct decklink_cctx *)avctx->priv_data;
480 q->avctx = avctx;
524 av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n");
589 static void handle_klv(AVFormatContext *avctx, decklink_ctx *ctx, IDeckLinkVideoInputFrame *videoFrame, int64_t pts)
619 av_log(avctx, AV_LOG_DEBUG, "Found KLV VANC packet on line: %d\n", packet->GetLineNumber());
627 av_log(avctx, AV_LOG_DEBUG, "KLV with MID: %d and PSC: %d\n", mid, psc);
642 av_log(avctx, AV_LOG_WARNING, "Out of order PSC: %d for MID: %d\n", psc, mid);
671 av_log(avctx, AV_LOG_DEBUG, "Joining MID: %d\n", (int)i);
705 AVFormatContext *avctx;
714 avctx = _avctx;
715 decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
792 static int get_bmd_timecode(AVFormatContext *avctx, AVTimecode *tc, AVRational frame_rate, BMDTimecodeFormat tc_format, IDeckLinkVideoInputFrame *videoFrame)
807 ret = av_timecode_init_from_components(tc, frame_rate, flags, hh, mm, ss, ff, avctx);
814 static int get_frame_timecode(AVFormatContext *avctx, decklink_ctx *ctx, AVTimecode *tc, IDeckLinkVideoInputFrame *videoFrame)
824 ret = get_bmd_timecode(avctx, tc, frame_rate, bmdTimecodeRP188HighFrameRate, videoFrame);
827 ret = get_bmd_timecode(avctx, tc, frame_rate, bmdTimecodeRP188VITC1, videoFrame);
829 ret = get_bmd_timecode(avctx, tc, frame_rate, bmdTimecodeRP188VITC2, videoFrame);
831 ret = get_bmd_timecode(avctx, tc, frame_rate, bmdTimecodeRP188LTC, videoFrame);
833 ret = get_bmd_timecode(avctx, tc, frame_rate, ctx->tc_format, videoFrame);
846 struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
878 av_log(avctx, AV_LOG_DEBUG,
905 av_log(avctx, AV_LOG_WARNING, "Frame received (#%lu) - No input signal detected "
911 av_log(avctx, AV_LOG_WARNING, "Frame received (#%lu) - Input returned "
919 if (get_frame_timecode(avctx, ctx, &tcr, videoFrame) >= 0) {
950 av_log(avctx, AV_LOG_DEBUG, "Unable to find timecode.\n");
957 av_log(avctx, AV_LOG_WARNING, "No TC detected yet. wait_for_tc set. Dropping. \n");
958 av_log(avctx, AV_LOG_WARNING, "Frame received (#%lu) - "
982 handle_klv(avctx, ctx, videoFrame, pkt.pts);
1021 txt_buf = get_metadata(avctx, vanc, vanc_size,
1086 struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
1144 av_cold int ff_decklink_read_close(AVFormatContext *avctx)
1146 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
1155 ff_decklink_cleanup(avctx);
1163 av_cold int ff_decklink_read_header(AVFormatContext *avctx)
1165 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
1203 av_log(avctx, AV_LOG_ERROR, "Value of channels option must be one of 2, 8 or 16\n");
1213 av_log(avctx, AV_LOG_ERROR, "Value for audio bit depth option must be either 16 or 32\n");
1219 ff_decklink_list_devices_legacy(avctx, 1, 0);
1223 ret = ff_decklink_init_device(avctx, avctx->url);
1229 av_log(avctx, AV_LOG_ERROR, "Could not open input device from '%s'\n",
1230 avctx->url);
1235 if (ff_decklink_set_configs(avctx, DIRECTION_IN) < 0) {
1236 av_log(avctx, AV_LOG_ERROR, "Could not set input configuration\n");
1243 ff_decklink_list_formats(avctx, DIRECTION_IN);
1248 input_callback = new decklink_input_callback(avctx);
1252 av_log(avctx, AV_LOG_ERROR, "Cannot set input callback\n");
1260 av_log(avctx, AV_LOG_ERROR, "Cannot set custom memory allocator\n");
1266 av_log(avctx, AV_LOG_ERROR, "Cannot Autodetect input stream or No signal\n");
1270 av_log(avctx, AV_LOG_INFO, "Autodetected the input mode\n");
1274 if (ff_decklink_set_format(avctx, DIRECTION_IN) < 0) {
1275 av_log(avctx, AV_LOG_ERROR, "Could not set format code %s for %s\n",
1276 cctx->format_code ? cctx->format_code : "(unset)", avctx->url);
1283 av_log(avctx, AV_LOG_ERROR, "Libzvbi support is needed for capturing SD PAL teletext, please recompile FFmpeg.\n");
1290 st = avformat_new_stream(avctx, NULL);
1292 av_log(avctx, AV_LOG_ERROR, "Cannot add stream\n");
1303 st = avformat_new_stream(avctx, NULL);
1305 av_log(avctx, AV_LOG_ERROR, "Cannot add stream\n");
1344 av_log(avctx, AV_LOG_ERROR, "Raw Format %s not supported\n", fourcc_str);
1367 st = avformat_new_stream(avctx, NULL);
1381 st = avformat_new_stream(avctx, NULL);
1383 av_log(avctx, AV_LOG_ERROR, "Cannot add stream\n");
1395 av_log(avctx, AV_LOG_VERBOSE, "Using %d input audio channels\n", ctx->audio_st->codecpar->ch_layout.nb_channels);
1399 av_log(avctx, AV_LOG_ERROR, "Cannot enable audio input\n");
1409 av_log(avctx, AV_LOG_ERROR, "Cannot enable video input\n");
1414 avpacket_queue_init (avctx, &ctx->queue);
1417 av_log(avctx, AV_LOG_ERROR, "Cannot start input stream\n");
1425 ff_decklink_cleanup(avctx);
1429 int ff_decklink_read_packet(AVFormatContext *avctx, AVPacket *pkt)
1431 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
1441 av_log(avctx, AV_LOG_ERROR, "Unable to set timecode\n");
1448 int ff_decklink_list_input_devices(AVFormatContext *avctx, struct AVDeviceInfoList *device_list)
1450 return ff_decklink_list_devices(avctx, device_list, 1, 0);