Lines Matching defs:avctx
381 dshow_get_device_media_types(AVFormatContext *avctx, enum dshowDeviceType devtype,
462 dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
467 struct dshow_ctx *ctx = avctx->priv_data;
484 av_log(avctx, AV_LOG_ERROR, "Could not enumerate %s devices (or none found).\n",
536 av_log(avctx, AV_LOG_ERROR, "Unable to BindToObject for %s\n", device_name);
546 dshow_get_device_media_types(avctx, devtype, sourcetype, device_filter, &media_types, &nb_media_types);
578 av_log(avctx, AV_LOG_INFO, "\"%s\"", friendly_name);
581 av_log(avctx, AV_LOG_INFO, " (%s", media_type ? media_type : "unknown");
584 av_log(avctx, AV_LOG_INFO, ", %s", media_type ? media_type : "unknown");
586 av_log(avctx, AV_LOG_INFO, ")");
588 av_log(avctx, AV_LOG_INFO, " (none)");
590 av_log(avctx, AV_LOG_INFO, "\n");
591 av_log(avctx, AV_LOG_INFO, " Alternative name \"%s\"\n", unique_name);
618 av_log(avctx, AV_LOG_ERROR, "Could not find %s device with name [%s] among source devices of type %s.\n",
628 static int dshow_get_device_list(AVFormatContext *avctx, AVDeviceInfoList *device_list)
642 av_log(avctx, AV_LOG_ERROR, "Could not enumerate system devices.\n");
646 ret = dshow_cycle_devices(avctx, devenum, VideoDevice, VideoSourceDevice, NULL, NULL, &device_list);
649 ret = dshow_cycle_devices(avctx, devenum, AudioDevice, AudioSourceDevice, NULL, NULL, &device_list);
660 static int dshow_should_set_format(AVFormatContext *avctx, enum dshowDeviceType devtype)
662 struct dshow_ctx *ctx = avctx->priv_data;
794 dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
797 struct dshow_ctx *ctx = avctx->priv_data;
838 use_default = !dshow_should_set_format(avctx, devtype);
926 av_log(avctx, AV_LOG_INFO, " unknown compression type 0x%X", (int) bih->biCompression);
928 av_log(avctx, AV_LOG_INFO, " vcodec=%s", codec->name);
931 av_log(avctx, AV_LOG_INFO, " pixel_format=%s", av_get_pix_fmt_name(fmt_info->pix_fmt));
933 av_log(avctx, AV_LOG_INFO, " min s=%ldx%ld fps=%g max s=%ldx%ld fps=%g",
947 av_log(avctx, AV_LOG_INFO, " (%s, %s/%s/%s",
953 av_log(avctx, AV_LOG_INFO, ", %s", chroma ? chroma : "unknown");
954 av_log(avctx, AV_LOG_INFO, ")");
957 av_log(avctx, AV_LOG_INFO, "(%s)", chroma ? chroma : "unknown");
959 av_log(avctx, AV_LOG_INFO, "\n");
998 avctx,
1078 dshow_set_audio_buffer_size(AVFormatContext *avctx, IPin *pin)
1080 struct dshow_ctx *ctx = avctx->priv_data;
1122 ff_dshow_show_filter_properties(IBaseFilter *device_filter, AVFormatContext *avctx) {
1131 av_log(avctx, AV_LOG_WARNING, "requested filter does not have a property page to show");
1153 av_log(avctx, AV_LOG_ERROR, "Failure showing property pages for filter");
1172 dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
1175 struct dshow_ctx *ctx = avctx->priv_data;
1184 int set_format = dshow_should_set_format(avctx, devtype);
1189 ff_dshow_show_filter_properties(device_filter, avctx);
1193 av_log(avctx, AV_LOG_ERROR, "Could not enumerate pins.\n");
1198 av_log(avctx, AV_LOG_INFO, "DirectShow %s device options (from %s devices)\n",
1228 av_log(avctx, AV_LOG_ERROR, "Could not query pin id\n");
1234 av_log(avctx, AV_LOG_INFO, " Pin \"%s\" (alternative pin name \"%s\")\n", name_buf, pin_buf);
1235 dshow_cycle_formats(avctx, devtype, pin, NULL);
1241 av_log(avctx, AV_LOG_DEBUG, "skipping pin \"%s\" (\"%s\") != requested \"%s\"\n",
1249 dshow_cycle_formats(avctx, devtype, pin, &format_set);
1255 if (dshow_set_audio_buffer_size(avctx, pin) < 0) {
1256 av_log(avctx, AV_LOG_ERROR, "unable to set audio buffer size %d to pin, using pin anyway...", ctx->audio_buffer_size);
1262 av_log(avctx, AV_LOG_DEBUG, "Selecting pin %s on %s\n", name_buf, devtypename);
1279 av_log(avctx, AV_LOG_ERROR, "Could not set %s options\n", devtypename);
1283 av_log(avctx, AV_LOG_ERROR,
1299 dshow_list_device_options(AVFormatContext *avctx, ICreateDevEnum *devenum,
1302 struct dshow_ctx *ctx = avctx->priv_data;
1307 if ((r = dshow_cycle_devices(avctx, devenum, devtype, sourcetype, &device_filter, &device_unique_name, NULL)) < 0)
1311 if ((r = dshow_cycle_pins(avctx, devtype, sourcetype, device_filter, NULL)) < 0)
1317 dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
1320 struct dshow_ctx *ctx = avctx->priv_data;
1350 av_log(avctx, AV_LOG_ERROR, "Could not open capture filter description file.\n");
1356 av_log(avctx, AV_LOG_ERROR, "Could not load capture filter from file.\n");
1361 av_log(avctx, AV_LOG_INFO, "Audio-");
1363 av_log(avctx, AV_LOG_INFO, "Video-");
1364 av_log(avctx, AV_LOG_INFO, "Capture filter loaded successfully from file \"%s\".\n", filename);
1367 if ((r = dshow_cycle_devices(avctx, devenum, devtype, sourcetype, &device_filter, &device_filter_unique_name, NULL)) < 0) {
1376 av_log(avctx, AV_LOG_DEBUG, "reusing previous graph capture filter... %s\n", device_filter_unique_name);
1381 av_log(avctx, AV_LOG_DEBUG, "not reusing previous graph capture filter %s != %s\n", device_filter_unique_name, ctx->device_unique_name[otherDevType]);
1390 av_log(avctx, AV_LOG_ERROR, "Could not add device filter to graph.\n");
1394 if ((r = dshow_cycle_pins(avctx, devtype, sourcetype, device_filter, &device_pin)) < 0) {
1401 capture_filter = ff_dshow_filter_Create(avctx, callback, devtype);
1403 av_log(avctx, AV_LOG_ERROR, "Could not create grabber filter.\n");
1421 av_log(avctx, AV_LOG_ERROR, "Could not create capture filter description file.\n");
1427 av_log(avctx, AV_LOG_ERROR, "Query for IPersistStream failed.\n");
1433 av_log(avctx, AV_LOG_ERROR, "Could not save capture filter \n");
1439 av_log(avctx, AV_LOG_ERROR, "Could not commit capture filter data to file.\n");
1444 av_log(avctx, AV_LOG_INFO, "Audio-");
1446 av_log(avctx, AV_LOG_INFO, "Video-");
1447 av_log(avctx, AV_LOG_INFO, "Capture filter saved successfully to file \"%s\".\n", filename);
1453 av_log(avctx, AV_LOG_ERROR, "Could not add capture filter to graph\n");
1464 av_log(avctx, AV_LOG_ERROR, "Could not create CaptureGraphBuilder2\n");
1469 av_log(avctx, AV_LOG_ERROR, "Could not set graph for CaptureGraphBuilder2\n");
1477 av_log(avctx, AV_LOG_ERROR, "Could not RenderStream to connect pins\n");
1481 r = ff_dshow_try_setup_crossbar_options(graph_builder2, device_filter, devtype, avctx);
1484 av_log(avctx, AV_LOG_ERROR, "Could not setup CrossBar\n");
1527 dshow_add_device(AVFormatContext *avctx,
1530 struct dshow_ctx *ctx = avctx->priv_data;
1539 st = avformat_new_stream(avctx, NULL);
1570 av_log(avctx, AV_LOG_ERROR, "Could not get media type.\n");
1583 av_log(avctx, AV_LOG_DEBUG, "attempt to use full range for HDYC...\n");
1607 av_log(avctx, AV_LOG_ERROR, "Unknown compression type. "
1616 av_log(avctx, AV_LOG_ERROR, "Could not get media type.\n");
1638 static int parse_device_name(AVFormatContext *avctx)
1640 struct dshow_ctx *ctx = avctx->priv_data;
1642 char *name = av_strdup(avctx->url);
1675 static int dshow_read_header(AVFormatContext *avctx)
1677 struct dshow_ctx *ctx = avctx->priv_data;
1689 if (!ctx->list_devices && !parse_device_name(avctx)) {
1690 av_log(avctx, AV_LOG_ERROR, "Malformed dshow input string.\n");
1694 ctx->video_codec_id = avctx->video_codec_id ? avctx->video_codec_id
1698 av_log(avctx, AV_LOG_ERROR, "Pixel format may only be set when "
1707 av_log(avctx, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", ctx->framerate);
1715 av_log(avctx, AV_LOG_ERROR, "Could not create capture graph.\n");
1723 av_log(avctx, AV_LOG_ERROR, "Could not enumerate system devices.\n");
1728 dshow_cycle_devices(avctx, devenum, VideoDevice, VideoSourceDevice, NULL, NULL, NULL);
1729 dshow_cycle_devices(avctx, devenum, AudioDevice, AudioSourceDevice, NULL, NULL, NULL);
1735 if ((r = dshow_list_device_options(avctx, devenum, VideoDevice, VideoSourceDevice))) {
1740 if (dshow_list_device_options(avctx, devenum, AudioDevice, AudioSourceDevice)) {
1742 if ((r = dshow_list_device_options(avctx, devenum, AudioDevice, VideoSourceDevice))) {
1751 if ((r = dshow_open_device(avctx, devenum, VideoDevice, VideoSourceDevice)) < 0 ||
1752 (r = dshow_add_device(avctx, VideoDevice)) < 0) {
1758 if ((r = dshow_open_device(avctx, devenum, AudioDevice, AudioSourceDevice)) < 0 ||
1759 (r = dshow_add_device(avctx, AudioDevice)) < 0) {
1760 av_log(avctx, AV_LOG_INFO, "Searching for audio device within video devices for %s\n", ctx->device_name[AudioDevice]);
1762 if ((r = dshow_open_device(avctx, devenum, AudioDevice, VideoSourceDevice)) < 0 ||
1763 (r = dshow_add_device(avctx, AudioDevice)) < 0) {
1778 av_log(avctx, AV_LOG_ERROR, "Could not create Mutex\n");
1783 av_log(avctx, AV_LOG_ERROR, "Could not create Event\n");
1789 av_log(avctx, AV_LOG_ERROR, "Could not get media control.\n");
1796 av_log(avctx, AV_LOG_ERROR, "Could not get media event.\n");
1803 av_log(avctx, AV_LOG_ERROR, "Could not get media event handle.\n");
1810 av_log(avctx, AV_LOG_ERROR, "Could not duplicate media event handle.\n");
1820 av_log(avctx, AV_LOG_ERROR, "Could not run graph (sometimes caused by a device already in use by other application)\n");
1832 dshow_read_close(avctx);