diff options
author | rogerdpack <rogerpack2005@gmail.com> | 2014-03-27 13:44:20 -0600 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-28 00:22:55 +0100 |
commit | 773eb74babe07bc5c97c32aa564efc40e2d4b00c (patch) | |
tree | 0cc3e4a631a5112ae171f61c67d60f87270b0e8f /libavdevice | |
parent | 64b79141bdfdffaa9fda69eecce140473d0a9a18 (diff) | |
download | ffmpeg-773eb74babe07bc5c97c32aa564efc40e2d4b00c.tar.gz |
dshow: show device name when outputting buffer overflow log message
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/dshow.c | 8 | ||||
-rw-r--r-- | libavdevice/dshow_capture.h | 2 | ||||
-rw-r--r-- | libavdevice/dshow_pin.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 5d4e87c279..adf36a7b32 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -180,7 +180,7 @@ static char *dup_wchar_to_utf8(wchar_t *w) return s; } -static int shall_we_drop(AVFormatContext *s, int index) +static int shall_we_drop(AVFormatContext *s, int index, enum dshowDeviceType devtype) { struct dshow_ctx *ctx = s->priv_data; static const uint8_t dropscore[] = {62, 75, 87, 100}; @@ -189,7 +189,7 @@ static int shall_we_drop(AVFormatContext *s, int index) if(dropscore[++ctx->video_frame_num%ndropscores] <= buffer_fullness) { av_log(s, AV_LOG_ERROR, - "real-time buffer[%d] too full (%d%% of size: %d)! frame dropped!\n", index, buffer_fullness, s->max_picture_buffer); + "real-time buffer[%s] too full (%d%% of size: %d)! frame dropped!\n", ctx->device_name[devtype], buffer_fullness, s->max_picture_buffer); return 1; } @@ -197,7 +197,7 @@ static int shall_we_drop(AVFormatContext *s, int index) } static void -callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time) +callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType devtype) { AVFormatContext *s = priv_data; struct dshow_ctx *ctx = s->priv_data; @@ -207,7 +207,7 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time) WaitForSingleObject(ctx->mutex, INFINITE); - if(shall_we_drop(s, index)) + if(shall_we_drop(s, index, devtype)) goto fail; pktl_next = av_mallocz(sizeof(AVPacketList)); diff --git a/libavdevice/dshow_capture.h b/libavdevice/dshow_capture.h index aff5019b30..e4b4dce3fa 100644 --- a/libavdevice/dshow_capture.h +++ b/libavdevice/dshow_capture.h @@ -254,7 +254,7 @@ struct libAVFilter { void *priv_data; int stream_index; int64_t start_time; - void (*callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time); + void (*callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType type); }; long WINAPI libAVFilter_QueryInterface (libAVFilter *, const GUID *, void **); diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c index 30e4d9585c..1c0dca2409 100644 --- a/libavdevice/dshow_pin.c +++ b/libavdevice/dshow_pin.c @@ -328,7 +328,7 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample) priv_data = pin->filter->priv_data; index = pin->filter->stream_index; - pin->filter->callback(priv_data, index, buf, buf_size, curtime); + pin->filter->callback(priv_data, index, buf, buf_size, curtime, devtype); return S_OK; } |