[FFmpeg-cvslog] img2 encoder: allow %t in filename, based on patch from Yuval Adam

2016-11-01 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Tue Oct 25 
18:33:12 2016 -0600| [1a956c64c8eff5edecb004fc7aafd21207e6485c] | committer: 
Michael Niedermayer

img2 encoder: allow %t in filename, based on patch from Yuval Adam

Signed-off-by: rogerdpack 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a956c64c8eff5edecb004fc7aafd21207e6485c
---

 doc/muxers.texi| 13 +
 libavformat/avformat.h |  3 ++-
 libavformat/hlsenc.c   |  6 +++---
 libavformat/img2enc.c  |  6 --
 libavformat/utils.c| 42 ++
 5 files changed, 60 insertions(+), 10 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 0d856db..0c3a198 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -619,6 +619,12 @@ If the pattern contains "%d" or "%0@var{N}d", the first 
filename of
 the file list specified will contain the number 1, all the following
 numbers will be sequential.
 
+If the pattern contains "%t", the frame's timestamps will be inserted
+in the filename like "00.00.00.000" for hours, minutes, seconds,
+and milliseconds.
+
+The "%t" and "%d" patterns may be used simultaneously.
+
 The pattern may contain a suffix which is used to automatically
 determine the format of the image files to write.
 
@@ -664,6 +670,13 @@ can be used:
 ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 
"%Y-%m-%d_%H-%M-%S.jpg"
 @end example
 
+The following example uses the timestamp parameter to generate one
+image file per video frame from the input, and name it including its original
+timestamp.
+@example
+ffmpeg -i in.avi -vsync vfr -copyts img-%t.jpg
+@end example
+
 @subsection Options
 
 @table @option
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index f9f4d72..7f39698 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2780,10 +2780,11 @@ void av_dump_format(AVFormatContext *ic,
  * @param path numbered sequence string
  * @param number frame number
  * @param flags AV_FRAME_FILENAME_FLAGS_*
+ * @param ts frame timestamp in AV_TIME_BASE fractional seconds.
  * @return 0 if OK, -1 on format error
  */
 int av_get_frame_filename2(char *buf, int buf_size,
-  const char *path, int number, int flags);
+  const char *path, int number, int flags, int64_t ts);
 
 int av_get_frame_filename(char *buf, int buf_size,
   const char *path, int number);
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 9ca2df7..02d8d44 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -654,7 +654,7 @@ static int hls_start(AVFormatContext *s)
 } else if (c->max_seg_size > 0) {
 if (av_get_frame_filename2(oc->filename, sizeof(oc->filename),
 c->basename, c->wrap ? c->sequence % c->wrap : c->sequence,
-AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0) {
+AV_FRAME_FILENAME_FLAGS_MULTIPLE, 0) < 0) {
 av_log(oc, AV_LOG_ERROR, "Invalid segment filename template 
'%s', you can try to use -use_localtime 1 with it\n", c->basename);
 return AVERROR(EINVAL);
 }
@@ -685,14 +685,14 @@ static int hls_start(AVFormatContext *s)
 }
 } else if (av_get_frame_filename2(oc->filename, sizeof(oc->filename),
   c->basename, c->wrap ? c->sequence % c->wrap 
: c->sequence,
-  AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0) {
+  AV_FRAME_FILENAME_FLAGS_MULTIPLE, 0) < 0) {
 av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s' 
you can try to use -use_localtime 1 with it\n", c->basename);
 return AVERROR(EINVAL);
 }
 if( c->vtt_basename) {
 if (av_get_frame_filename2(vtt_oc->filename, 
sizeof(vtt_oc->filename),
   c->vtt_basename, c->wrap ? c->sequence % c->wrap 
: c->sequence,
-  AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0) {
+  AV_FRAME_FILENAME_FLAGS_MULTIPLE, 0) < 0) {
 av_log(vtt_oc, AV_LOG_ERROR, "Invalid segment filename 
template '%s'\n", c->vtt_basename);
 return AVERROR(EINVAL);
 }
diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 1297b1a..69dbebe 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -80,10 +80,12 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 VideoMuxData *img = s->priv_data;
 AVIOContext *pb[4];
 char filename[1024];
-AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar;
+AVStream *stream = s->streams[ pkt->stream_index ];
+  

[FFmpeg-cvslog] img2 encoder: use more descriptive vsync names

2016-11-01 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Tue Oct 25 
18:33:30 2016 -0600| [8459e6fd122715365a4d8b613d88298b3c4acdd7] | committer: 
Michael Niedermayer

img2 encoder: use more descriptive vsync names

Signed-off-by: rogerdpack 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8459e6fd122715365a4d8b613d88298b3c4acdd7
---

 doc/muxers.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 0c3a198..ef2116a 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -641,7 +641,7 @@ The following example shows how to use @command{ffmpeg} for 
creating a
 sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ...,
 taking one image every second from the input video:
 @example
-ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
+ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
 @end example
 
 Note that with @command{ffmpeg}, if the format is not specified with the
@@ -649,12 +649,12 @@ Note that with @command{ffmpeg}, if the format is not 
specified with the
 format, the image2 muxer is automatically selected, so the previous
 command can be written as:
 @example
-ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
+ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
 @end example
 
 Note also that the pattern must not necessarily contain "%d" or
 "%0@var{N}d", for example to create a single image file
-@file{img.jpeg} from the input video you can employ the command:
+@file{img.jpeg} from the start of the input video you can employ the command:
 @example
 ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
 @end example

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dshow: avoid duplicate NULL check before free

2016-06-22 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jun 17 
14:04:34 2016 -0600| [bfbffbd7d8fd014a3693c51d7cde9926315a9fa0] | committer: 
Michael Niedermayer

dshow: avoid duplicate NULL check before free

Signed-off-by: rogerdpack 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bfbffbd7d8fd014a3693c51d7cde9926315a9fa0
---

 libavdevice/dshow.c |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index a60e7c1..f2453e6 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -104,14 +104,10 @@ dshow_read_close(AVFormatContext *s)
 if (ctx->device_filter[AudioDevice])
 IBaseFilter_Release(ctx->device_filter[AudioDevice]);
 
-if (ctx->device_name[0])
-av_freep(&ctx->device_name[0]);
-if (ctx->device_name[1])
-av_freep(&ctx->device_name[1]);
-if (ctx->device_unique_name[0])
-av_freep(&ctx->device_unique_name[0]);
-if (ctx->device_unique_name[1])
-av_freep(&ctx->device_unique_name[1]);
+av_freep(&ctx->device_name[0]);
+av_freep(&ctx->device_name[1]);
+av_freep(&ctx->device_unique_name[0]);
+av_freep(&ctx->device_unique_name[1]);
 
 if(ctx->mutex)
 CloseHandle(ctx->mutex);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dshow: don't add two instances of same device to graphs

2016-06-22 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Wed Jun 15 
02:17:11 2016 -0600| [9e907c040d3e6c5dbc94c198d147e7456b7c93c1] | committer: 
Michael Niedermayer

dshow: don't add two instances of same device to graphs

Signed-off-by: rogerdpack 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e907c040d3e6c5dbc94c198d147e7456b7c93c1
---

 libavdevice/dshow.c |   37 ++---
 libavdevice/dshow_capture.h |2 ++
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 5f2cad7..a60e7c1 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -108,6 +108,10 @@ dshow_read_close(AVFormatContext *s)
 av_freep(&ctx->device_name[0]);
 if (ctx->device_name[1])
 av_freep(&ctx->device_name[1]);
+if (ctx->device_unique_name[0])
+av_freep(&ctx->device_unique_name[0]);
+if (ctx->device_unique_name[1])
+av_freep(&ctx->device_unique_name[1]);
 
 if(ctx->mutex)
 CloseHandle(ctx->mutex);
@@ -205,7 +209,8 @@ fail:
  */
 static int
 dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
-enum dshowDeviceType devtype, enum dshowSourceFilterType 
sourcetype, IBaseFilter **pfilter)
+enum dshowDeviceType devtype, enum dshowSourceFilterType 
sourcetype,
+IBaseFilter **pfilter, char **device_unique_name)
 {
 struct dshow_ctx *ctx = avctx->priv_data;
 IBaseFilter *device_filter = NULL;
@@ -276,10 +281,13 @@ dshow_cycle_devices(AVFormatContext *avctx, 
ICreateDevEnum *devenum,
 av_log(avctx, AV_LOG_ERROR, "Unable to BindToObject for 
%s\n", device_name);
 goto fail1;
 }
+*device_unique_name = unique_name;
+// success, loop will end now
 }
 } else {
 av_log(avctx, AV_LOG_INFO, " \"%s\"\n", friendly_name);
 av_log(avctx, AV_LOG_INFO, "Alternative name \"%s\"\n", 
unique_name);
+av_free(unique_name);
 }
 
 fail1:
@@ -288,7 +296,6 @@ fail1:
 if (bind_ctx)
 IBindCtx_Release(bind_ctx);
 av_free(friendly_name);
-av_free(unique_name);
 if (bag)
 IPropertyBag_Release(bag);
 IMoniker_Release(m);
@@ -706,14 +713,15 @@ dshow_list_device_options(AVFormatContext *avctx, 
ICreateDevEnum *devenum,
 {
 struct dshow_ctx *ctx = avctx->priv_data;
 IBaseFilter *device_filter = NULL;
+char *device_unique_name = NULL;
 int r;
 
-if ((r = dshow_cycle_devices(avctx, devenum, devtype, sourcetype, 
&device_filter)) < 0)
+if ((r = dshow_cycle_devices(avctx, devenum, devtype, sourcetype, 
&device_filter, &device_unique_name)) < 0)
 return r;
 ctx->device_filter[devtype] = device_filter;
 if ((r = dshow_cycle_pins(avctx, devtype, sourcetype, device_filter, 
NULL)) < 0)
 return r;
-
+av_freep(&device_unique_name);
 return 0;
 }
 
@@ -723,6 +731,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 {
 struct dshow_ctx *ctx = avctx->priv_data;
 IBaseFilter *device_filter = NULL;
+char *device_filter_unique_name = NULL;
 IGraphBuilder *graph = ctx->graph;
 IPin *device_pin = NULL;
 libAVPin *capture_pin = NULL;
@@ -733,6 +742,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 IStream *ifile_stream = NULL;
 IStream *ofile_stream = NULL;
 IPersistStream *pers_stream = NULL;
+enum dshowDeviceType otherDevType = (devtype == VideoDevice) ? AudioDevice 
: VideoDevice;
 
 const wchar_t *filter_name[2] = { L"Audio capture filter", L"Video capture 
filter" };
 
@@ -766,13 +776,26 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 av_log(avctx, AV_LOG_INFO, "Capture filter loaded successfully from 
file \"%s\".\n", filename);
 } else {
 
-if ((r = dshow_cycle_devices(avctx, devenum, devtype, sourcetype, 
&device_filter)) < 0) {
+if ((r = dshow_cycle_devices(avctx, devenum, devtype, sourcetype, 
&device_filter, &device_filter_unique_name)) < 0) {
 ret = r;
 goto error;
 }
 }
+if (ctx->device_filter[otherDevType]) {
+// avoid adding add two instances of the same device to the graph, one 
for video, one for audio
+// a few devices don't support this (could also do this check earlier 
to avoid double crossbars, etc. but they seem OK)
+if (strcmp(device_filter_unique_name, 
ctx->device_unique_name[otherDevType]) == 0) {
+  av_log(avctx, AV_LOG_DEBUG, "reusing previous graph capture 
filter... %s\n&quo

[FFmpeg-cvslog] dshow: add options for allowing filter popup configuration dialogs to be presented to the user

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:49:37 2015 -0700| [5d72cf0f64162aa130b4720f71e9249a6a34f08a] | committer: 
rogerdpack

dshow: add options for allowing filter popup configuration dialogs to be 
presented to the user

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d72cf0f64162aa130b4720f71e9249a6a34f08a
---

 configure|2 +-
 doc/indevs.texi  |   26 ++
 libavdevice/dshow.c  |   62 +-
 libavdevice/dshow_capture.h  |1 +
 libavdevice/dshow_crossbar.c |7 +
 5 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index a0dbafb..0b6be39 100755
--- a/configure
+++ b/configure
@@ -2487,7 +2487,7 @@ decklink_outdev_extralibs="-lstdc++"
 decklink_indev_deps="decklink pthreads"
 decklink_indev_extralibs="-lstdc++"
 dshow_indev_deps="IBaseFilter"
-dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
+dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32"
 dv1394_indev_deps="dv1394"
 dv1394_indev_select="dv_demuxer"
 fbdev_indev_deps="linux_fb_h"
diff --git a/doc/indevs.texi b/doc/indevs.texi
index ec40c34..a9792fd 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -234,6 +234,25 @@ routed to the crossbar device's Video Decoder output pin.
 Select audio input pin number for crossbar device. This will be
 routed to the crossbar device's Audio Decoder output pin.
 
+@item show_video_device_dialog
+If set to @option{true}, before capture starts, popup a display dialog
+to the end user, allowing them to change video filter properties
+and configurations manually.
+Note that for crossbar devices, this may be needed at times to toggle
+between PAL and NTSC input frame rates and sizes, etc.  Possibly 
+enabling different scan rates/frame rates and avoiding green bars at
+the bottom, etc.
+
+@item show_audio_device_dialog
+If set to @option{true}, before capture starts, popup a display dialog
+to the end user, allowing them to change audio filter properties
+and configurations manually.
+
+@item show_crossbar_connection_dialog
+If set to @option{true}, before capture starts, popup a display
+dialog to the end user, allowing them to manually
+modify crossbar pin routings.
+
 @end table
 
 @subsection Examples
@@ -276,6 +295,13 @@ Specify pin names to capture by name or alternative name, 
specify alternative de
 $ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i 
video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
 @end example
 
+@item
+Configure a crossbar device, specifying crossbar pins, allow user to adjust 
video capture properties at startup:
+@example
+$ ffmpeg -f dshow -show_video_device_dialog true 
-crossbar_video_input_pin_number 0
+ -crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog 
Capture":audio="AVerMedia BDA Analog Capture"
+@end example
+
 @end itemize
 
 @section dv1394
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 6349377..691250f 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -503,6 +503,53 @@ end:
 }
 
 /**
+ * Pops up a user dialog allowing them to adjust properties for the given 
filter, if possible.
+ */
+void
+dshow_show_filter_properties(IBaseFilter *device_filter, AVFormatContext 
*avctx) {
+ISpecifyPropertyPages *property_pages = NULL;
+IUnknown *device_filter_iunknown = NULL;
+HRESULT hr;
+FILTER_INFO filter_info = {0}; /* a warning on this line is false positive 
GCC bug 53119 */
+CAUUID ca_guid = {0};
+
+hr  = IBaseFilter_QueryInterface(device_filter, 
&IID_ISpecifyPropertyPages, (void **)&property_pages);
+if (hr != S_OK) {
+av_log(avctx, AV_LOG_WARNING, "requested filter does not have a 
property page to show");
+goto end;
+}
+hr = IBaseFilter_QueryFilterInfo(device_filter, &filter_info);
+if (hr != S_OK) {
+goto fail;
+}
+hr = IBaseFilter_QueryInterface(device_filter, &IID_IUnknown, (void 
**)&device_filter_iunknown);
+if (hr != S_OK) {
+goto fail;
+}
+hr = ISpecifyPropertyPages_GetPages(property_pages, &ca_guid);
+if (hr != S_OK) {
+goto fail;
+}
+hr = OleCreatePropertyFrame(NULL, 0, 0, filter_info.achName, 1, 
&device_filter_iunknown, ca_guid.cElems,
+ca_guid.pElems, 0, 0, NULL);
+if (hr != S_OK) {
+goto fail;
+}
+goto end;
+fail:
+av_log(avctx, AV_LOG_ERROR, "Failure showing property pages for filter");
+end:
+if (property_pages)
+ISpecifyPropertyPages_Release(property_pages);
+

[FFmpeg-cvslog] dshow: introduce support for crossbar [multiple input selectable] devices

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:35:16 2015 -0700| [ec81ad21c1f8124dcde08c1e64656331d4c3d9e6] | committer: 
rogerdpack

dshow: introduce support for crossbar [multiple input selectable] devices

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec81ad21c1f8124dcde08c1e64656331d4c3d9e6
---

 doc/indevs.texi  |8 +++
 libavdevice/Makefile |2 +-
 libavdevice/dshow.c  |   97 -
 libavdevice/dshow_capture.h  |   61 
 libavdevice/dshow_crossbar.c |  164 ++
 5 files changed, 278 insertions(+), 54 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 00820af..ec40c34 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -226,6 +226,14 @@ Select video capture pin to use by name or alternative 
name.
 @item audio_pin_name
 Select audio capture pin to use by name or alternative name.
 
+@item crossbar_video_input_pin_number
+Select video input pin number for crossbar device. This will be
+routed to the crossbar device's Video Decoder output pin.
+
+@item crossbar_audio_input_pin_number
+Select audio input pin number for crossbar device. This will be
+routed to the crossbar device's Audio Decoder output pin.
+
 @end table
 
 @subsection Examples
diff --git a/libavdevice/Makefile b/libavdevice/Makefile
index 872504b..696cc88 100644
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@ -19,7 +19,7 @@ OBJS-$(CONFIG_BKTR_INDEV)+= bktr.o
 OBJS-$(CONFIG_CACA_OUTDEV)   += caca.o
 OBJS-$(CONFIG_DECKLINK_OUTDEV)   += decklink_enc.o decklink_enc_c.o 
decklink_common.o
 OBJS-$(CONFIG_DECKLINK_INDEV)+= decklink_dec.o decklink_dec_c.o 
decklink_common.o
-OBJS-$(CONFIG_DSHOW_INDEV)   += dshow.o dshow_enummediatypes.o \
+OBJS-$(CONFIG_DSHOW_INDEV)   += dshow_crossbar.o dshow.o 
dshow_enummediatypes.o \
 dshow_enumpins.o dshow_filter.o \
 dshow_pin.o dshow_common.o
 OBJS-$(CONFIG_DV1394_INDEV)  += dv1394.o
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 0a5788d..6349377 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -28,51 +28,6 @@
 #include "avdevice.h"
 #include "libavcodec/raw.h"
 
-struct dshow_ctx {
-const AVClass *class;
-
-IGraphBuilder *graph;
-
-char *device_name[2];
-int video_device_number;
-int audio_device_number;
-
-int   list_options;
-int   list_devices;
-int   audio_buffer_size;
-char *video_pin_name;
-char *audio_pin_name;
-
-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;
-};
 
 static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount)
 {
@@ -710,8 +665,7 @@ dshow_list_device_options(AVFormatContext *avctx, 
ICreateDevEnum *devenum,
 }
 
 static int
-dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
-  enum dshowDeviceType devtype)
+dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, enum 
dshowDeviceType devtype)
 {
 struct dshow_ctx *ctx = avctx->priv_data;
 IBaseFilter *device_filter = NULL;
@@ -719,6 +673,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 IPin *device_pin = NULL;
 libAVPin *capture_pin = NULL;
 libAVFilter *capture_filter = NULL;
+ICaptureGraphBuilder2 *graph_builder2 = NULL;
 int ret = AVERROR(EIO);
 int r;
 
@@ -741,6 +696,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 ret = r;
 goto error;
 }
+
 ctx->device_pin[devtype] = device_pin;
 
 capture_filter = libAVFilter_Create(avctx, callback, devtype);
@@ -761,15 +717,39 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 capture_pin = capture_filter->pin;
 ctx->capture_pin[devtype] = capture_pin;
 
-r = IGraphBuilder_ConnectDirect(graph, device_pin, (IPin *) capture_pin, 
NULL);
+r = CoCreateInstance(&CLSID_CaptureGraphBuilder2, NULL, 
CLSCTX_INPROC_SERVER,
+ &IID_ICaptureGraphBuilder2, (void **) 
&graph_builder2);
+if (r != S_OK) {
+av_log(avctx, AV_LOG_ERROR, "

[FFmpeg-cvslog] dshow: miscellaneous tweaks

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:01:32 2015 -0700| [e620eee88c4fdd43eb45001e4ec073110aea78d8] | committer: 
rogerdpack

dshow: miscellaneous tweaks

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e620eee88c4fdd43eb45001e4ec073110aea78d8
---

 libavdevice/dshow.c |   13 -
 libavdevice/dshow_capture.h |2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 0497e09..4883b33 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -188,10 +188,12 @@ static int shall_we_drop(AVFormatContext *s, int index, 
enum dshowDeviceType dev
 static const uint8_t dropscore[] = {62, 75, 87, 100};
 const int ndropscores = FF_ARRAY_ELEMS(dropscore);
 unsigned int buffer_fullness = 
(ctx->curbufsize[index]*100)/s->max_picture_buffer;
+const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
 
 if(dropscore[++ctx->video_frame_num%ndropscores] <= buffer_fullness) {
 av_log(s, AV_LOG_ERROR,
-  "real-time buffer[%s] too full (%d%% of size: %d)! frame 
dropped!\n", ctx->device_name[devtype], buffer_fullness, s->max_picture_buffer);
+  "real-time buffer [%s] [%s input] too full or near too full 
(%d%% of size: %d [rtbufsize parameter])! frame dropped!\n",
+  ctx->device_name[devtype], devtypename, buffer_fullness, 
s->max_picture_buffer);
 return 1;
 }
 
@@ -366,7 +368,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum 
dshowDeviceType devtype,
 AM_MEDIA_TYPE *type = NULL;
 int format_set = 0;
 void *caps = NULL;
-int i, n, size;
+int i, n, size, r;
 
 if (IPin_QueryInterface(pin, &IID_IAMStreamConfig, (void **) &config) != 
S_OK)
 return;
@@ -378,8 +380,9 @@ dshow_cycle_formats(AVFormatContext *avctx, enum 
dshowDeviceType devtype,
 goto end;
 
 for (i = 0; i < n && !format_set; i++) {
-IAMStreamConfig_GetStreamCaps(config, i, &type, (void *) caps);
-
+r = IAMStreamConfig_GetStreamCaps(config, i, &type, (void *) caps);
+if (r != S_OK)
+goto next;
 #if DSHOWDEBUG
 ff_print_AM_MEDIA_TYPE(type);
 #endif
@@ -643,6 +646,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum 
dshowDeviceType devtype,
 goto next;
 
 IEnumMediaTypes_Reset(types);
+/* in case format_set was not called, just verify the majortype */
 while (!device_pin && IEnumMediaTypes_Next(types, 1, &type, NULL) == 
S_OK) {
 if (IsEqualGUID(&type->majortype, mediatype[devtype])) {
 device_pin = pin;
@@ -663,7 +667,6 @@ next:
 av_free(pin_buf);
 if (pin_id)
 CoTaskMemFree(pin_id);
-
 }
 
 IEnumPins_Release(pins);
diff --git a/libavdevice/dshow_capture.h b/libavdevice/dshow_capture.h
index 0252070..09e9b1b 100644
--- a/libavdevice/dshow_capture.h
+++ b/libavdevice/dshow_capture.h
@@ -223,7 +223,7 @@ libAVEnumPins   *libAVEnumPins_Create (libAVPin *pin, 
libAVFilter *filter);
  * libAVEnumMediaTypes
  /
 struct libAVEnumMediaTypes {
-IEnumPinsVtbl *vtbl;
+IEnumMediaTypesVtbl *vtbl;
 long ref;
 int pos;
 AM_MEDIA_TYPE type;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dshow: use non deprecated api

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:07:24 2015 -0700| [8eb5b5ec6f582cac25195682680907c9ac52374a] | committer: 
rogerdpack

dshow: use non deprecated api

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8eb5b5ec6f582cac25195682680907c9ac52374a
---

 libavdevice/dshow.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 4883b33..0a5788d 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -162,7 +162,7 @@ dshow_read_close(AVFormatContext *s)
 pktl = ctx->pktl;
 while (pktl) {
 AVPacketList *next = pktl->next;
-av_destruct_packet(&pktl->pkt);
+av_free_packet(&pktl->pkt);
 av_free(pktl);
 pktl = next;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dshow: drop initial audio packets with weird timestamps

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:13:33 2015 -0700| [b76a0e24f9effa64e48ff0567af0dc497dd99e84] | committer: 
rogerdpack

dshow: drop initial audio packets with weird timestamps

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b76a0e24f9effa64e48ff0567af0dc497dd99e84
---

 libavdevice/dshow_pin.c |8 
 1 file changed, 8 insertions(+)

diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c
index 1c0dca2..5904c28 100644
--- a/libavdevice/dshow_pin.c
+++ b/libavdevice/dshow_pin.c
@@ -320,6 +320,14 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, 
IMediaSample *sample)
 } else {
 int64_t dummy;
 IMediaSample_GetTime(sample, &curtime, &dummy);
+if(curtime > 40LL) {
+/* initial frames sometimes start < 0 (shown as a very large 
number here,
+   like 437650244077016960 which FFmpeg doesn't like.
+   TODO figure out math. For now just drop them. */
+av_log(NULL, AV_LOG_DEBUG,
+"dshow dropping initial (or ending) audio frame with odd PTS 
too high %"PRId64"\n", curtime);
+return S_OK;
+}
 curtime += pin->filter->start_time;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dshow: fix docu escapes

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
08:31:58 2015 -0700| [b587ec00f7b6df7c46efd115a544c0686bcbd833] | committer: 
rogerdpack

dshow: fix docu escapes

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b587ec00f7b6df7c46efd115a544c0686bcbd833
---

 doc/indevs.texi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index a9792fd..1a5203f 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -292,7 +292,7 @@ $ ffmpeg -list_options true -f dshow -i video="Camera"
 @item
 Specify pin names to capture by name or alternative name, specify alternative 
device name:
 @example
-$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i 
video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
+$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i 
video=video="@@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#@{65e8773d-8f56-11d0-a3b9-00a0c9223196@}\@{ca465100-deb0-4d59-818f-8c477184adf6@}":audio="Microphone"
 @end example
 
 @item

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dshow: some devices only list themselves under "Video sources" but

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:54:44 2015 -0700| [a35da0920d787d96569171a7c2dff5893144232f] | committer: 
rogerdpack

dshow: some devices only list themselves under "Video sources" but
actually have both video and audio output pins, so make the audio pins
accessible by video source name.

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a35da0920d787d96569171a7c2dff5893144232f
---

 libavdevice/dshow.c |   81 ---
 libavdevice/dshow_capture.h |5 +++
 2 files changed, 50 insertions(+), 36 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 691250f..e34b77c 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -203,7 +203,7 @@ fail:
  */
 static int
 dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
-enum dshowDeviceType devtype, IBaseFilter **pfilter)
+enum dshowDeviceType devtype, enum dshowSourceFilterType 
sourcetype, IBaseFilter **pfilter)
 {
 struct dshow_ctx *ctx = avctx->priv_data;
 IBaseFilter *device_filter = NULL;
@@ -216,12 +216,13 @@ dshow_cycle_devices(AVFormatContext *avctx, 
ICreateDevEnum *devenum,
 
 const GUID *device_guid[2] = { &CLSID_VideoInputDeviceCategory,
&CLSID_AudioInputDeviceCategory };
-const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
+const char *devtypename = (devtype == VideoDevice) ? "video" : "audio 
only";
+const char *sourcetypename = (sourcetype == VideoSourceDevice) ? "video" : 
"audio";
 
-r = ICreateDevEnum_CreateClassEnumerator(devenum, device_guid[devtype],
+r = ICreateDevEnum_CreateClassEnumerator(devenum, device_guid[sourcetype],
  (IEnumMoniker **) &classenum, 0);
 if (r != S_OK) {
-av_log(avctx, AV_LOG_ERROR, "Could not enumerate %s devices.\n",
+av_log(avctx, AV_LOG_ERROR, "Could not enumerate %s devices (or none 
found).\n",
devtypename);
 return AVERROR(EIO);
 }
@@ -253,7 +254,6 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 unique_name[i] = '_';
 }
 
-
 r = IMoniker_BindToStorage(m, 0, 0, &IID_IPropertyBag, (void *) &bag);
 if (r != S_OK)
 goto fail1;
@@ -262,10 +262,9 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 r = IPropertyBag_Read(bag, L"FriendlyName", &var, NULL);
 if (r != S_OK)
 goto fail1;
-
 friendly_name = dup_wchar_to_utf8(var.bstrVal);
 
- if (pfilter) {
+if (pfilter) {
 if (strcmp(device_name, friendly_name) && strcmp(device_name, 
unique_name))
 goto fail1;
 
@@ -291,15 +290,14 @@ fail1:
 if (bag)
 IPropertyBag_Release(bag);
 IMoniker_Release(m);
-
 }
 
 IEnumMoniker_Release(classenum);
 
 if (pfilter) {
 if (!device_filter) {
-av_log(avctx, AV_LOG_ERROR, "Could not find %s device.\n",
-   devtypename);
+av_log(avctx, AV_LOG_ERROR, "Could not find %s device with name 
[%s] among source devices of type %s.\n",
+   devtypename, device_name, sourcetypename);
 return AVERROR(EIO);
 }
 *pfilter = device_filter;
@@ -510,7 +508,7 @@ dshow_show_filter_properties(IBaseFilter *device_filter, 
AVFormatContext *avctx)
 ISpecifyPropertyPages *property_pages = NULL;
 IUnknown *device_filter_iunknown = NULL;
 HRESULT hr;
-FILTER_INFO filter_info = {0}; /* a warning on this line is false positive 
GCC bug 53119 */
+FILTER_INFO filter_info = {0}; /* a warning on this line is false positive 
GCC bug 53119 AFAICT */
 CAUUID ca_guid = {0};
 
 hr  = IBaseFilter_QueryInterface(device_filter, 
&IID_ISpecifyPropertyPages, (void **)&property_pages);
@@ -557,7 +555,7 @@ end:
  */
 static int
 dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
- IBaseFilter *device_filter, IPin **ppin)
+ enum dshowSourceFilterType sourcetype, IBaseFilter 
*device_filter, IPin **ppin)
 {
 struct dshow_ctx *ctx = avctx->priv_data;
 IEnumPins *pins = 0;
@@ -566,7 +564,8 @@ dshow_cycle_pins(AVFormatContext *avctx, enum 
dshowDeviceType devtype,
 int r;
 
 const GUID *mediatype[2] = { &MEDIATYPE_Video, &MEDIATYPE_Audio };
-const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
+const char *devtypename = (devtype == VideoDevice) ? "video" : "audio 
only";
+const char *sourcetypename = (sourcetype == VideoSourceDevice) ? "video" : 
"aud

[FFmpeg-cvslog] dshow: allow selecting devices by an alternative name ( workaround for devices with symbols in them), allow specifying capture pins by name and alternative (unique) name

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
05:34:30 2015 -0700| [d01234419b615792cd6447cb925ba16cc12ef32e] | committer: 
rogerdpack

dshow: allow selecting devices by an alternative name (workaround for devices 
with symbols in them), allow specifying capture pins by name and alternative 
(unique) name

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d01234419b615792cd6447cb925ba16cc12ef32e
---

 doc/indevs.texi |   14 +++-
 libavdevice/dshow.c |   88 ---
 2 files changed, 89 insertions(+), 13 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index fa6facf..00820af 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -167,7 +167,7 @@ The input name should be in the format:
 @end example
 
 where @var{TYPE} can be either @var{audio} or @var{video},
-and @var{NAME} is the device's name.
+and @var{NAME} is the device's name or alternative name..
 
 @subsection Options
 
@@ -220,6 +220,12 @@ Setting this value too low can degrade performance.
 See also
 
@url{http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx}
 
+@item video_pin_name
+Select video capture pin to use by name or alternative name.
+
+@item audio_pin_name
+Select audio capture pin to use by name or alternative name.
+
 @end table
 
 @subsection Examples
@@ -256,6 +262,12 @@ Print the list of supported options in selected device and 
exit:
 $ ffmpeg -list_options true -f dshow -i video="Camera"
 @end example
 
+@item
+Specify pin names to capture by name or alternative name, specify alternative 
device name:
+@example
+$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i 
video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
+@end example
+
 @end itemize
 
 @section dv1394
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index f326ca2..0497e09 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -40,6 +40,8 @@ struct dshow_ctx {
 int   list_options;
 int   list_devices;
 int   audio_buffer_size;
+char *video_pin_name;
+char *audio_pin_name;
 
 IBaseFilter *device_filter[2];
 IPin*device_pin[2];
@@ -269,8 +271,31 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 
 while (!device_filter && IEnumMoniker_Next(classenum, 1, &m, NULL) == 
S_OK) {
 IPropertyBag *bag = NULL;
-char *buf = NULL;
+char *friendly_name = NULL;
+char *unique_name = NULL;
 VARIANT var;
+IBindCtx *bind_ctx = NULL;
+LPOLESTR olestr = NULL;
+LPMALLOC co_malloc = NULL;
+int i;
+
+r = CoGetMalloc(1, &co_malloc);
+if (r = S_OK)
+goto fail1;
+r = CreateBindCtx(0, &bind_ctx);
+if (r != S_OK)
+goto fail1;
+/* GetDisplayname works for both video and audio, DevicePath doesn't */
+r = IMoniker_GetDisplayName(m, bind_ctx, NULL, &olestr);
+if (r != S_OK)
+goto fail1;
+unique_name = dup_wchar_to_utf8(olestr);
+/* replace ':' with '_' since we use : to delineate between sources */
+for (i = 0; i < strlen(unique_name); i++) {
+if (unique_name[i] == ':')
+unique_name[i] = '_';
+}
+
 
 r = IMoniker_BindToStorage(m, 0, 0, &IID_IPropertyBag, (void *) &bag);
 if (r != S_OK)
@@ -281,23 +306,35 @@ dshow_cycle_devices(AVFormatContext *avctx, 
ICreateDevEnum *devenum,
 if (r != S_OK)
 goto fail1;
 
-buf = dup_wchar_to_utf8(var.bstrVal);
+friendly_name = dup_wchar_to_utf8(var.bstrVal);
 
-if (pfilter) {
-if (strcmp(device_name, buf))
+ if (pfilter) {
+if (strcmp(device_name, friendly_name) && strcmp(device_name, 
unique_name))
 goto fail1;
 
-if (!skip--)
-IMoniker_BindToObject(m, 0, 0, &IID_IBaseFilter, (void *) 
&device_filter);
+if (!skip--) {
+r = IMoniker_BindToObject(m, 0, 0, &IID_IBaseFilter, (void *) 
&device_filter);
+if (r != S_OK) {
+av_log(avctx, AV_LOG_ERROR, "Unable to BindToObject for 
%s\n", device_name);
+goto fail1;
+}
+}
 } else {
-av_log(avctx, AV_LOG_INFO, " \"%s\"\n", buf);
+av_log(avctx, AV_LOG_INFO, " \"%s\"\n", friendly_name);
+av_log(avctx, AV_LOG_INFO, "Alternative name \"%s\"\n", 
unique_name);
 }
 
 fail1:
-av_free(buf);
+if 

[FFmpeg-cvslog] dshow: add properties dialog for tv tuners

2015-01-26 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Sat Jan 24 
19:56:02 2015 -0700| [c55fa2f09bdab7c0655bbf2a5cbdac5fda939494] | committer: 
rogerdpack

dshow: add properties dialog for tv tuners

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c55fa2f09bdab7c0655bbf2a5cbdac5fda939494
---

 doc/indevs.texi  |   10 +
 libavdevice/dshow.c  |6 ++
 libavdevice/dshow_capture.h  |2 ++
 libavdevice/dshow_crossbar.c |   47 --
 4 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 75ad76f..c3d0827 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -253,6 +253,16 @@ If set to @option{true}, before capture starts, popup a 
display
 dialog to the end user, allowing them to manually
 modify crossbar pin routings.
 
+@item show_analog_tv_tuner_dialog
+If set to @option{true}, before capture starts, popup a display
+dialog to the end user, allowing them to manually
+modify TV channels and frequencies.
+
+@item show_analog_tv_tuner_audio_dialog
+If set to @option{true}, before capture starts, popup a display
+dialog to the end user, allowing them to manually
+modify TV audio (like mono vs. stereo, Language A,B or C).
+
 @end table
 
 @subsection Examples
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

[FFmpeg-cvslog] dshow: tweak logging

2015-01-26 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Mon Jan 26 
02:03:48 2015 -0700| [61974c7dcca833687d4f3834c7e8200a63a7b4af] | committer: 
rogerdpack

dshow: tweak logging

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=61974c7dcca833687d4f3834c7e8200a63a7b4af
---

 libavdevice/dshow.c |4 ++--
 libavdevice/dshow_pin.c |   12 +---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 9ca2519..d03670e 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1044,7 +1044,7 @@ static int dshow_read_header(AVFormatContext *avctx)
 if (ctx->device_name[AudioDevice]) {
 if ((r = dshow_open_device(avctx, devenum, AudioDevice, 
AudioSourceDevice)) < 0 ||
 (r = dshow_add_device(avctx, AudioDevice)) < 0) {
-av_log(avctx, AV_LOG_INFO, "Searching for audio device within 
video devices %s\n", ctx->device_name[AudioDevice]);
+av_log(avctx, AV_LOG_INFO, "Searching for audio device within 
video devices for %s\n", ctx->device_name[AudioDevice]);
 /* see if there's a video source with an audio pin with the given 
audio name */
 if ((r = dshow_open_device(avctx, devenum, AudioDevice, 
VideoSourceDevice)) < 0 ||
 (r = dshow_add_device(avctx, AudioDevice)) < 0) {
@@ -1104,7 +1104,7 @@ static int dshow_read_header(AVFormatContext *avctx)
 r = IMediaControl_GetState(control, 0, &pfs);
 }
 if (r != S_OK) {
-av_log(avctx, AV_LOG_ERROR, "Could not run filter\n");
+av_log(avctx, AV_LOG_ERROR, "Could not run graph (sometimes caused by 
a device already in use by other application)\n");
 goto error;
 }
 
diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c
index 5904c28..4f719a6 100644
--- a/libavdevice/dshow_pin.c
+++ b/libavdevice/dshow_pin.c
@@ -304,21 +304,25 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, 
IMediaSample *sample)
 enum dshowDeviceType devtype = pin->filter->type;
 void *priv_data;
 uint8_t *buf;
-int buf_size;
+int buf_size; /* todo should be a long? */
 int index;
 int64_t curtime;
+int64_t orig_curtime;
+const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
+IReferenceClock *clock = pin->filter->clock;
+int64_t dummy;
 
 dshowdebug("libAVMemInputPin_Receive(%p)\n", this);
 
 if (!sample)
 return E_POINTER;
 
+IMediaSample_GetTime(sample, &orig_curtime, &dummy);
+orig_curtime += pin->filter->start_time;
 if (devtype == VideoDevice) {
 /* PTS from video devices is unreliable. */
-IReferenceClock *clock = pin->filter->clock;
 IReferenceClock_GetTime(clock, &curtime);
 } else {
-int64_t dummy;
 IMediaSample_GetTime(sample, &curtime, &dummy);
 if(curtime > 40LL) {
 /* initial frames sometimes start < 0 (shown as a very large 
number here,
@@ -336,6 +340,8 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, 
IMediaSample *sample)
 priv_data = pin->filter->priv_data;
 index = pin->filter->stream_index;
 
+av_log(NULL, AV_LOG_VERBOSE, "dshow passing through packet of type %s size 
%6d timestamp %"PRId64" orig timestamp %"PRId64"\n",
+   devtypename, buf_size, curtime, orig_curtime);
 pin->filter->callback(priv_data, index, buf, buf_size, curtime, devtype);
 
 return S_OK;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dshow: crossbar dialog was frequently being displayed twice, split up option so it can be just once

2015-01-26 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Mon Jan 26 
01:29:58 2015 -0700| [7c2e26270124fc81babcfc7b9d070bb8bd8ab6fa] | committer: 
rogerdpack

dshow: crossbar dialog was frequently being displayed twice, split up option so 
it can be just once

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c2e26270124fc81babcfc7b9d070bb8bd8ab6fa
---

 doc/indevs.texi  |9 +++--
 libavdevice/dshow.c  |9 ++---
 libavdevice/dshow_capture.h  |3 ++-
 libavdevice/dshow_crossbar.c |3 ++-
 4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index a35c7a6..ae61331 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -255,10 +255,15 @@ If set to @option{true}, before capture starts, popup a 
display dialog
 to the end user, allowing them to change audio filter properties
 and configurations manually.
 
-@item show_crossbar_connection_dialog
+@item show_video_crossbar_connection_dialog
 If set to @option{true}, before capture starts, popup a display
 dialog to the end user, allowing them to manually
-modify crossbar pin routings.
+modify crossbar pin routings, when it opens a video device.
+
+@item show_audio_crossbar_connection_dialog
+If set to @option{true}, before capture starts, popup a display
+dialog to the end user, allowing them to manually
+modify crossbar pin routings, when it opens an audio device.
 
 @item show_analog_tv_tuner_dialog
 If set to @option{true}, before capture starts, popup a display
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index d881bfa..9ca2519 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1199,9 +1199,12 @@ static const AVOption options[] = {
 { "show_audio_device_dialog", "display property dialog for audio capture 
device", OFFSET(show_audio_device_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 
DEC, "show_audio_device_dialog" },
 { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, 
"show_audio_device_dialog" },
 { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, 
"show_audio_device_dialog" },
-{ "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_video_crossbar_connection_dialog", "display property dialog for 
crossbar connecting pins filter on video device", 
OFFSET(show_video_crossbar_connection_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 
1, DEC, "show_video_crossbar_connection_dialog" },
+{ "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, 
"show_video_crossbar_connection_dialog" },
+{ "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, 
"show_video_crossbar_connection_dialog" },
+{ "show_audio_crossbar_connection_dialog", "display property dialog for 
crossbar connecting pins filter on audio device", 
OFFSET(show_audio_crossbar_connection_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 
1, DEC, "show_audio_crossbar_connection_dialog" },
+{ "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, 
"show_audio_crossbar_connection_dialog" },
+{ "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, 
"show_audio_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" },
diff --git a/libavdevice/dshow_capture.h b/libavdevice/dshow_capture.h
index 11ab23c..f258476 100644
--- a/libavdevice/dshow_capture.h
+++ b/libavdevice/dshow_capture.h
@@ -303,7 +303,8 @@ struct dshow_ctx {
 char *audio_pin_name;
 int   show_video_device_dialog;
 int   show_audio_device_dialog;
-int   show_crossbar_connection_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;
 
diff --git a/libavdevice/dshow_crossbar.c b/libavdevice/dshow_crossbar.c
index e3012df..c0739da 100644
--- a/li

[FFmpeg-cvslog] dshow: alert as to ramifications of switching crossbar routing

2015-01-26 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Mon Jan 26 
01:08:04 2015 -0700| [ce1bbb08f127ecb724c2c62791cad70c30dd270b] | committer: 
rogerdpack

dshow: alert as to ramifications of switching crossbar routing

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce1bbb08f127ecb724c2c62791cad70c30dd270b
---

 doc/indevs.texi |   15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index c3d0827..a35c7a6 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -229,19 +229,26 @@ Select audio capture pin to use by name or alternative 
name.
 @item crossbar_video_input_pin_number
 Select video input pin number for crossbar device. This will be
 routed to the crossbar device's Video Decoder output pin.
+Note that changing this value can affect future invocations
+(sets a new default) until system reboot occurs.
 
 @item crossbar_audio_input_pin_number
 Select audio input pin number for crossbar device. This will be
 routed to the crossbar device's Audio Decoder output pin.
+Note that changing this value can affect future invocations
+(sets a new default) until system reboot occurs.
 
 @item show_video_device_dialog
 If set to @option{true}, before capture starts, popup a display dialog
 to the end user, allowing them to change video filter properties
 and configurations manually.
-Note that for crossbar devices, this may be needed at times to toggle
-between PAL and NTSC input frame rates and sizes, etc.  Possibly
-enabling different scan rates/frame rates and avoiding green bars at
-the bottom, etc.
+Note that for crossbar devices, adjusting values in this dialog
+may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
+input frame rates, sizes, interlacing, etc.  Changing these values can
+enable different scan rates/frame rates and avoiding green bars at
+the bottom, flickering scan lines, etc.
+Note that with some devices, changing these properties can also affect future
+invocations (sets new defaults) until system reboot occurs.
 
 @item show_audio_device_dialog
 If set to @option{true}, before capture starts, popup a display dialog

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffmpeg: log error message when shutting down from too many signals

2015-06-25 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Thu Jun 25 
12:22:10 2015 +0200| [1bcdac2da3ca228d9ba2334e26fa314e2abd45b2] | committer: 
Michael Niedermayer

ffmpeg: log error message when shutting down from too many signals

write() suggested by wm4
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1bcdac2da3ca228d9ba2334e26fa314e2abd45b2
---

 ffmpeg.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 1cf4487..fae5f0f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -321,8 +321,11 @@ sigterm_handler(int sig)
 received_sigterm = sig;
 received_nb_signals++;
 term_exit_sigsafe();
-if(received_nb_signals > 3)
+if(received_nb_signals > 3) {
+write(STDERR_FILENO, "Received > 3 system signals, hard exiting\n",
+  strlen("Received > 3 system signals, hard exiting\n"));
 exit(123);
+}
 }
 
 void term_init(void)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] modify exit message when signaled

2015-06-25 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Thu Jun 25 
00:24:31 2015 -0600| [87961eff23abf710b575488ac62ee7d121a4ea07] | committer: 
Michael Niedermayer

modify exit message when signaled

Signed-off-by: rogerdpack 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87961eff23abf710b575488ac62ee7d121a4ea07
---

 ffmpeg.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index fae5f0f..f537ce9 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -530,7 +530,7 @@ static void ffmpeg_cleanup(int ret)
 avformat_network_deinit();
 
 if (received_sigterm) {
-av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
+av_log(NULL, AV_LOG_INFO, "Exiting normally, received signal %d.\n",
(int) received_sigterm);
 } else if (ret && transcode_init_done) {
 av_log(NULL, AV_LOG_INFO, "Conversion failed!\n");

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffmpeg: windows: respond to logoff and ctrl+break messages as well

2015-06-30 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Tue Jun 30 
16:31:19 2015 -0600| [4ebb43f19c416e1601730ca9ae57749b1385c563] | committer: 
Michael Niedermayer

ffmpeg: windows: respond to logoff and ctrl+break messages as well

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ebb43f19c416e1601730ca9ae57749b1385c563
---

 configure |2 ++
 ffmpeg.c  |   41 +
 2 files changed, 43 insertions(+)

diff --git a/configure b/configure
index 89b5668..cc23991 100755
--- a/configure
+++ b/configure
@@ -1787,6 +1787,7 @@ SYSTEM_FUNCS="
 pthread_cancel
 sched_getaffinity
 SetConsoleTextAttribute
+SetConsoleCtrlHandler
 setmode
 setrlimit
 Sleep
@@ -4990,6 +4991,7 @@ check_func_headers windows.h GetSystemTimeAsFileTime
 check_func_headers windows.h MapViewOfFile
 check_func_headers windows.h PeekNamedPipe
 check_func_headers windows.h SetConsoleTextAttribute
+check_func_headers windows.h SetConsoleCtrlHandler
 check_func_headers windows.h Sleep
 check_func_headers windows.h VirtualAlloc
 check_struct windows.h "CONDITION_VARIABLE" Ptr
diff --git a/ffmpeg.c b/ffmpeg.c
index 37f096c..e592629 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -79,6 +79,10 @@
 #include 
 #include 
 #endif
+#if HAVE_SETCONSOLECTRLHANDLER
+#include 
+#endif
+
 
 #if HAVE_SYS_SELECT_H
 #include 
@@ -313,6 +317,7 @@ void term_exit(void)
 static volatile int received_sigterm = 0;
 static volatile int received_nb_signals = 0;
 static volatile int transcode_init_done = 0;
+static volatile int ffmpeg_exited = 0;
 static int main_return_code = 0;
 
 static void
@@ -329,6 +334,38 @@ sigterm_handler(int sig)
 }
 }
 
+#if HAVE_SETCONSOLECTRLHANDLER
+static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
+{
+av_log(NULL, AV_LOG_DEBUG, "\nReceived windows signal %ld\n", fdwCtrlType);
+
+switch (fdwCtrlType)
+{
+case CTRL_C_EVENT:
+case CTRL_BREAK_EVENT:
+sigterm_handler(SIGINT);
+return TRUE;
+
+case CTRL_CLOSE_EVENT:
+case CTRL_LOGOFF_EVENT:
+case CTRL_SHUTDOWN_EVENT:
+sigterm_handler(SIGTERM);
+/* Basically, with these 3 events, when we return from this method the
+   process is hard terminated, so stall as long as we need to
+   to try and let the main thread(s) clean up and gracefully terminate
+   (we have at most 5 seconds, but should be done far before that). */
+while (!ffmpeg_exited) {
+Sleep(0);
+}
+return TRUE;
+
+default:
+av_log(NULL, AV_LOG_ERROR, "Received unknown windows signal %ld\n", 
fdwCtrlType);
+return FALSE;
+}
+}
+#endif
+
 void term_init(void)
 {
 #if HAVE_TERMIOS_H
@@ -362,6 +399,9 @@ void term_init(void)
 #ifdef SIGXCPU
 signal(SIGXCPU, sigterm_handler);
 #endif
+#if HAVE_SETCONSOLECTRLHANDLER
+SetConsoleCtrlHandler((PHANDLER_ROUTINE) CtrlHandler, TRUE);
+#endif
 }
 
 /* read a key without blocking */
@@ -537,6 +577,7 @@ static void ffmpeg_cleanup(int ret)
 av_log(NULL, AV_LOG_INFO, "Conversion failed!\n");
 }
 term_exit();
+ffmpeg_exited = 1;
 }
 
 void remove_avoptions(AVDictionary **a, AVDictionary *b)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffmpeg_filter: log more information on failure to init simple filter graph

2015-07-01 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Wed Jul  1 
13:23:55 2015 -0600| [a1c03b9d58824d984a93f79a8939749b0699bfee] | committer: 
Michael Niedermayer

ffmpeg_filter: log more information on failure to init simple filter graph

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1c03b9d58824d984a93f79a8939749b0699bfee
---

 ffmpeg_filter.c |   23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 0be49be..1ae8207 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -947,8 +947,27 @@ int configure_filtergraph(FilterGraph *fg)
 return ret;
 
 if (simple && (!inputs || inputs->next || !outputs || outputs->next)) {
-av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' does not have "
-   "exactly one input and output.\n", graph_desc);
+const char *num_inputs;
+const char *num_outputs;
+if (!outputs) {
+num_outputs = "0";
+} else if (outputs->next) {
+num_outputs = ">1";
+} else {
+num_outputs = "1";
+}
+if (!inputs) {
+num_inputs = "0";
+} else if (inputs->next) {
+num_inputs = ">1";
+} else {
+num_inputs = "1";
+}
+av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' was expected "
+   "to have exactly 1 input and 1 output."
+   " However, it had %s input(s) and %s output(s)."
+   " Please adjust, or use a complex filtergraph (-filter_complex) 
instead.\n",
+   graph_desc, num_inputs, num_outputs);
 return AVERROR(EINVAL);
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dshow: show more debug timestamp info

2015-07-31 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Thu Jul 30 
15:55:19 2015 -0600| [bed1d9ec7a259454365b2db1f5880209b17c4174] | committer: 
Michael Niedermayer

dshow: show more debug timestamp info

Signed-off-by: rogerdpack 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bed1d9ec7a259454365b2db1f5880209b17c4174
---

 libavdevice/dshow_pin.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c
index 4f719a6..664246d 100644
--- a/libavdevice/dshow_pin.c
+++ b/libavdevice/dshow_pin.c
@@ -303,14 +303,18 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, 
IMediaSample *sample)
 libAVPin *pin = (libAVPin *) ((uint8_t *) this - imemoffset);
 enum dshowDeviceType devtype = pin->filter->type;
 void *priv_data;
+AVFormatContext *s;
 uint8_t *buf;
 int buf_size; /* todo should be a long? */
 int index;
 int64_t curtime;
 int64_t orig_curtime;
+int64_t graphtime;
 const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
 IReferenceClock *clock = pin->filter->clock;
 int64_t dummy;
+struct dshow_ctx *ctx;
+
 
 dshowdebug("libAVMemInputPin_Receive(%p)\n", this);
 
@@ -319,6 +323,7 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, 
IMediaSample *sample)
 
 IMediaSample_GetTime(sample, &orig_curtime, &dummy);
 orig_curtime += pin->filter->start_time;
+IReferenceClock_GetTime(clock, &graphtime);
 if (devtype == VideoDevice) {
 /* PTS from video devices is unreliable. */
 IReferenceClock_GetTime(clock, &curtime);
@@ -338,10 +343,13 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, 
IMediaSample *sample)
 buf_size = IMediaSample_GetActualDataLength(sample);
 IMediaSample_GetPointer(sample, &buf);
 priv_data = pin->filter->priv_data;
+s = priv_data;
+ctx = s->priv_data;
 index = pin->filter->stream_index;
 
-av_log(NULL, AV_LOG_VERBOSE, "dshow passing through packet of type %s size 
%6d timestamp %"PRId64" orig timestamp %"PRId64"\n",
-   devtypename, buf_size, curtime, orig_curtime);
+av_log(NULL, AV_LOG_VERBOSE, "dshow passing through packet of type %s size 
%8d "
+"timestamp %"PRId64" orig timestamp %"PRId64" graph timestamp 
%"PRId64" diff %"PRId64" %s\n",
+devtypename, buf_size, curtime, orig_curtime, graphtime, graphtime - 
orig_curtime, ctx->device_name[devtype]);
 pin->filter->callback(priv_data, index, buf, buf_size, curtime, devtype);
 
 return S_OK;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] configure: Print out enabled programs

2015-08-27 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Thu Aug 27 
16:16:44 2015 -0600| [832b4a4a438b73d720878d77aa3db46b08d79937] | committer: 
Timothy Gu

configure: Print out enabled programs

Better message that ffplay is not going to be built by printing out what
will be built.

Based on a patch by Moritz Barsnick.

Signed-off-by: rogerdpack 
Reviewed-by: Ganesh Ajjanagadde 
Signed-off-by: Timothy Gu 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=832b4a4a438b73d720878d77aa3db46b08d79937
---

 configure |4 
 1 file changed, 4 insertions(+)

diff --git a/configure b/configure
index 8840027..5913090 100755
--- a/configure
+++ b/configure
@@ -5958,6 +5958,10 @@ test -n "$random_seed" &&
 echo "random seed   ${random_seed}"
 echo
 
+echo "Enabled programs:"
+print_enabled '' $PROGRAM_LIST | print_3_columns
+echo
+
 echo "External libraries:"
 print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
 echo

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] gdigrab: fix gdi object leak if using mouse

2014-08-19 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Tue Aug 19 
07:42:18 2014 -0600| [ea97859c8c218b83ab747a7eabcb88ca446f6751] | committer: 
Michael Niedermayer

gdigrab: fix gdi object leak if using mouse

based on patch from hlszl1...@163.com

Signed-off-by: rogerdpack 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea97859c8c218b83ab747a7eabcb88ca446f6751
---

 libavdevice/gdigrab.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c
index bccfef2..9a185d4 100644
--- a/libavdevice/gdigrab.c
+++ b/libavdevice/gdigrab.c
@@ -440,6 +440,8 @@ static void paint_mouse_pointer(AVFormatContext *s1, struct 
gdigrab *gdigrab)
 POINT pos;
 RECT clip_rect = gdigrab->clip_rect;
 HWND hwnd = gdigrab->hwnd;
+info.hbmMask = NULL;
+info.hbmColor = NULL;
 
 if (ci.flags != CURSOR_SHOWING)
 return;
@@ -481,6 +483,10 @@ static void paint_mouse_pointer(AVFormatContext *s1, 
struct gdigrab *gdigrab)
 }
 
 icon_error:
+if (info.hbmMask)
+DeleteObject(info.hbmMask);
+if (info.hbmColor)
+DeleteObject(info.hbmColor);
 if (icon)
 DestroyCursor(icon);
 } else {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog