summaryrefslogtreecommitdiffstats
path: root/libavdevice
diff options
context:
space:
mode:
authorrogerdpack <rogerpack2005@gmail.com>2015-01-24 19:56:02 -0700
committerrogerdpack <rogerpack2005@gmail.com>2015-01-26 00:28:26 -0700
commitc55fa2f09bdab7c0655bbf2a5cbdac5fda939494 (patch)
treedde39fa2c6427422ea0b953c66dcc13e98309947 /libavdevice
parentf994000dc5e472bae11b029261294eab32297afc (diff)
downloadffmpeg-streaming-c55fa2f09bdab7c0655bbf2a5cbdac5fda939494.zip
ffmpeg-streaming-c55fa2f09bdab7c0655bbf2a5cbdac5fda939494.tar.gz
dshow: add properties dialog for tv tuners
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/dshow.c6
-rw-r--r--libavdevice/dshow_capture.h2
-rw-r--r--libavdevice/dshow_crossbar.c47
3 files changed, 49 insertions, 6 deletions
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index e34b77c..d881bfa 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1202,6 +1202,12 @@ static const AVOption options[] = {
{ "show_crossbar_connection_dialog", "display property dialog for crossbar connecting pins filter", OFFSET(show_crossbar_connection_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC, "show_crossbar_connection_dialog" },
{ "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "show_crossbar_connection_dialog" },
{ "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "show_crossbar_connection_dialog" },
+ { "show_analog_tv_tuner_dialog", "display property dialog for analog tuner filter", OFFSET(show_analog_tv_tuner_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC, "show_analog_tv_tuner_dialog" },
+ { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "show_analog_tv_tuner_dialog" },
+ { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "show_analog_tv_tuner_dialog" },
+ { "show_analog_tv_tuner_audio_dialog", "display property dialog for analog tuner audio filter", OFFSET(show_analog_tv_tuner_audio_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC, "show_analog_tv_tuner_dialog" },
+ { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "show_analog_tv_tuner_audio_dialog" },
+ { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "show_analog_tv_tuner_audio_dialog" },
{ NULL },
};
diff --git a/libavdevice/dshow_capture.h b/libavdevice/dshow_capture.h
index 2e64776..11ab23c 100644
--- a/libavdevice/dshow_capture.h
+++ b/libavdevice/dshow_capture.h
@@ -304,6 +304,8 @@ struct dshow_ctx {
int show_video_device_dialog;
int show_audio_device_dialog;
int show_crossbar_connection_dialog;
+ int show_analog_tv_tuner_dialog;
+ int show_analog_tv_tuner_audio_dialog;
IBaseFilter *device_filter[2];
IPin *device_pin[2];
diff --git a/libavdevice/dshow_crossbar.c b/libavdevice/dshow_crossbar.c
index 9c63019..e3012df 100644
--- a/libavdevice/dshow_crossbar.c
+++ b/libavdevice/dshow_crossbar.c
@@ -142,23 +142,54 @@ dshow_try_setup_crossbar_options(ICaptureGraphBuilder2 *graph_builder2,
{
struct dshow_ctx *ctx = avctx->priv_data;
IAMCrossbar *cross_bar = NULL;
- IBaseFilter *cross_bar_filter = NULL;
+ IBaseFilter *cross_bar_base_filter = NULL;
+ IAMTVTuner *tv_tuner_filter = NULL;
+ IBaseFilter *tv_tuner_base_filter = NULL;
+ IAMAudioInputMixer *tv_audio_filter = NULL;
+ IBaseFilter *tv_audio_base_filter = NULL;
HRESULT hr;
hr = ICaptureGraphBuilder2_FindInterface(graph_builder2, &LOOK_UPSTREAM_ONLY, (const GUID *) NULL,
- (IBaseFilter *) device_filter, &IID_IAMCrossbar, (void**) &cross_bar);
+ device_filter, &IID_IAMCrossbar, (void**) &cross_bar);
if (hr != S_OK) {
/* no crossbar found */
hr = S_OK;
goto end;
}
+ /* TODO some TV tuners apparently have multiple crossbars? */
if (ctx->show_crossbar_connection_dialog) {
- hr = IAMCrossbar_QueryInterface(cross_bar, &IID_IBaseFilter, (void **) &cross_bar_filter);
+ hr = IAMCrossbar_QueryInterface(cross_bar, &IID_IBaseFilter, (void **) &cross_bar_base_filter);
if (hr != S_OK)
goto end;
- dshow_show_filter_properties(cross_bar_filter, avctx);
+ dshow_show_filter_properties(cross_bar_base_filter, avctx);
}
+
+ if (devtype == VideoDevice && ctx->show_analog_tv_tuner_dialog) {
+ hr = ICaptureGraphBuilder2_FindInterface(graph_builder2, &LOOK_UPSTREAM_ONLY, NULL,
+ device_filter, &IID_IAMTVTuner, (void**) &tv_tuner_filter);
+ if (hr == S_OK) {
+ hr = IAMCrossbar_QueryInterface(tv_tuner_filter, &IID_IBaseFilter, (void **) &tv_tuner_base_filter);
+ if (hr != S_OK)
+ goto end;
+ dshow_show_filter_properties(tv_tuner_base_filter, avctx);
+ } else {
+ av_log(avctx, AV_LOG_WARNING, "unable to find a tv tuner to display dialog for!");
+ }
+ }
+ if (devtype == AudioDevice && ctx->show_analog_tv_tuner_audio_dialog) {
+ hr = ICaptureGraphBuilder2_FindInterface(graph_builder2, &LOOK_UPSTREAM_ONLY, NULL,
+ device_filter, &IID_IAMTVAudio, (void**) &tv_audio_filter);
+ if (hr == S_OK) {
+ hr = IAMCrossbar_QueryInterface(tv_audio_filter, &IID_IBaseFilter, (void **) &tv_audio_base_filter);
+ if (hr != S_OK)
+ goto end;
+ dshow_show_filter_properties(tv_audio_base_filter, avctx);
+ } else {
+ av_log(avctx, AV_LOG_WARNING, "unable to find a tv audio tuner to display dialog for!");
+ }
+ }
+
hr = setup_crossbar_options(cross_bar, devtype, avctx);
if (hr != S_OK)
goto end;
@@ -166,7 +197,11 @@ dshow_try_setup_crossbar_options(ICaptureGraphBuilder2 *graph_builder2,
end:
if (cross_bar)
IAMCrossbar_Release(cross_bar);
- if (cross_bar_filter)
- IBaseFilter_Release(cross_bar_filter);
+ if (cross_bar_base_filter)
+ IBaseFilter_Release(cross_bar_base_filter);
+ if (tv_tuner_filter)
+ IAMTVTuner_Release(tv_tuner_filter);
+ if (tv_tuner_base_filter)
+ IBaseFilter_Release(tv_tuner_base_filter);
return hr;
}
OpenPOWER on IntegriCloud