Fix missing used attribute for inline assembly variables
[ffmpeg.git] / libavdevice / dshow_capture.h
index 09e9b1b..475d62b 100644 (file)
@@ -19,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVDEVICE_DSHOW_H
-#define AVDEVICE_DSHOW_H
+#ifndef AVDEVICE_DSHOW_CAPTURE_H
+#define AVDEVICE_DSHOW_CAPTURE_H
 
 #define DSHOWDEBUG 0
 
@@ -33,6 +33,8 @@
 #include <dshow.h>
 #include <dvdmedia.h>
 
+#include "libavcodec/internal.h"
+
 /* EC_DEVICE_LOST is not defined in MinGW dshow headers. */
 #ifndef EC_DEVICE_LOST
 #define EC_DEVICE_LOST 0x1f
@@ -44,12 +46,8 @@ void ff_print_AUDIO_STREAM_CONFIG_CAPS(const AUDIO_STREAM_CONFIG_CAPS *caps);
 void ff_print_AM_MEDIA_TYPE(const AM_MEDIA_TYPE *type);
 void ff_printGUID(const GUID *g);
 
-#if DSHOWDEBUG
 extern const AVClass *ff_dshow_context_class_ptr;
-#define dshowdebug(...) av_log(&ff_dshow_context_class_ptr, AV_LOG_DEBUG, __VA_ARGS__)
-#else
-#define dshowdebug(...)
-#endif
+#define dshowdebug(...) ff_dlog(&ff_dshow_context_class_ptr, __VA_ARGS__)
 
 static inline void nothing(void *foo)
 {
@@ -65,6 +63,11 @@ enum dshowDeviceType {
     AudioDevice = 1,
 };
 
+enum dshowSourceFilterType {
+    VideoSourceDevice = 0,
+    AudioSourceDevice = 1,
+};
+
 #define DECLARE_QUERYINTERFACE(class, ...)                                   \
 long WINAPI                                                                  \
 class##_QueryInterface(class *this, const GUID *riid, void **ppvObject)      \
@@ -277,4 +280,75 @@ long          WINAPI libAVFilter_QueryVendorInfo(libAVFilter *, wchar_t **);
 void                 libAVFilter_Destroy(libAVFilter *);
 libAVFilter         *libAVFilter_Create (void *, void *, enum dshowDeviceType);
 
-#endif /* AVDEVICE_DSHOW_H */
+/*****************************************************************************
+ * dshow_ctx
+ ****************************************************************************/
+struct dshow_ctx {
+    const AVClass *class;
+
+    IGraphBuilder *graph;
+
+    char *device_name[2];
+    char *device_unique_name[2];
+
+    int video_device_number;
+    int audio_device_number;
+
+    int   list_options;
+    int   list_devices;
+    int   audio_buffer_size;
+    int   crossbar_video_input_pin_number;
+    int   crossbar_audio_input_pin_number;
+    char *video_pin_name;
+    char *audio_pin_name;
+    int   show_video_device_dialog;
+    int   show_audio_device_dialog;
+    int   show_video_crossbar_connection_dialog;
+    int   show_audio_crossbar_connection_dialog;
+    int   show_analog_tv_tuner_dialog;
+    int   show_analog_tv_tuner_audio_dialog;
+    char *audio_filter_load_file;
+    char *audio_filter_save_file;
+    char *video_filter_load_file;
+    char *video_filter_save_file;
+
+    IBaseFilter *device_filter[2];
+    IPin        *device_pin[2];
+    libAVFilter *capture_filter[2];
+    libAVPin    *capture_pin[2];
+
+    HANDLE mutex;
+    HANDLE event[2]; /* event[0] is set by DirectShow
+                      * event[1] is set by callback() */
+    AVPacketList *pktl;
+
+    int eof;
+
+    int64_t curbufsize[2];
+    unsigned int video_frame_num;
+
+    IMediaControl *control;
+    IMediaEvent *media_event;
+
+    enum AVPixelFormat pixel_format;
+    enum AVCodecID video_codec_id;
+    char *framerate;
+
+    int requested_width;
+    int requested_height;
+    AVRational requested_framerate;
+
+    int sample_rate;
+    int sample_size;
+    int channels;
+};
+
+/*****************************************************************************
+ * CrossBar
+ ****************************************************************************/
+HRESULT dshow_try_setup_crossbar_options(ICaptureGraphBuilder2 *graph_builder2,
+    IBaseFilter *device_filter, enum dshowDeviceType devtype, AVFormatContext *avctx);
+
+void dshow_show_filter_properties(IBaseFilter *pFilter, AVFormatContext *avctx);
+
+#endif /* AVDEVICE_DSHOW_CAPTURE_H */