|
@@ -303,14 +303,18 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
|
|
libAVPin *pin = (libAVPin *) ((uint8_t *) this - imemoffset);
|
|
libAVPin *pin = (libAVPin *) ((uint8_t *) this - imemoffset);
|
|
enum dshowDeviceType devtype = pin->filter->type;
|
|
enum dshowDeviceType devtype = pin->filter->type;
|
|
void *priv_data;
|
|
void *priv_data;
|
|
|
|
+ AVFormatContext *s;
|
|
uint8_t *buf;
|
|
uint8_t *buf;
|
|
int buf_size; /* todo should be a long? */
|
|
int buf_size; /* todo should be a long? */
|
|
int index;
|
|
int index;
|
|
int64_t curtime;
|
|
int64_t curtime;
|
|
int64_t orig_curtime;
|
|
int64_t orig_curtime;
|
|
|
|
+ int64_t graphtime;
|
|
const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
|
|
const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
|
|
IReferenceClock *clock = pin->filter->clock;
|
|
IReferenceClock *clock = pin->filter->clock;
|
|
int64_t dummy;
|
|
int64_t dummy;
|
|
|
|
+ struct dshow_ctx *ctx;
|
|
|
|
+
|
|
|
|
|
|
dshowdebug("libAVMemInputPin_Receive(%p)\n", this);
|
|
dshowdebug("libAVMemInputPin_Receive(%p)\n", this);
|
|
|
|
|
|
@@ -319,6 +323,7 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
|
|
|
|
|
|
IMediaSample_GetTime(sample, &orig_curtime, &dummy);
|
|
IMediaSample_GetTime(sample, &orig_curtime, &dummy);
|
|
orig_curtime += pin->filter->start_time;
|
|
orig_curtime += pin->filter->start_time;
|
|
|
|
+ IReferenceClock_GetTime(clock, &graphtime);
|
|
if (devtype == VideoDevice) {
|
|
if (devtype == VideoDevice) {
|
|
/* PTS from video devices is unreliable. */
|
|
/* PTS from video devices is unreliable. */
|
|
IReferenceClock_GetTime(clock, &curtime);
|
|
IReferenceClock_GetTime(clock, &curtime);
|
|
@@ -338,10 +343,13 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
|
|
buf_size = IMediaSample_GetActualDataLength(sample);
|
|
buf_size = IMediaSample_GetActualDataLength(sample);
|
|
IMediaSample_GetPointer(sample, &buf);
|
|
IMediaSample_GetPointer(sample, &buf);
|
|
priv_data = pin->filter->priv_data;
|
|
priv_data = pin->filter->priv_data;
|
|
|
|
+ s = priv_data;
|
|
|
|
+ ctx = s->priv_data;
|
|
index = pin->filter->stream_index;
|
|
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);
|
|
pin->filter->callback(priv_data, index, buf, buf_size, curtime, devtype);
|
|
|
|
|
|
return S_OK;
|
|
return S_OK;
|