libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)

{

    libAVPin *pin = (libAVPin *) ((uint8_t *) this - imemoffset);

    enum dshowDeviceType devtype = pin->filter->type;

    void *priv_data;

    uint8_t *buf;

    int buf_size;

    int index;

    int64_t curtime;



    dshowdebug("libAVMemInputPin_Receive(%p)\n", this);



    if (!sample)

        return E_POINTER;



    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);

        curtime += pin->filter->start_time;

    }



    buf_size = IMediaSample_GetActualDataLength(sample);

    IMediaSample_GetPointer(sample, &buf);

    priv_data = pin->filter->priv_data;

    index = pin->filter->stream_index;



    pin->filter->callback(priv_data, index, buf, buf_size, curtime);



    return S_OK;

}

libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)

{

    libAVPin *pin = (libAVPin *) ((uint8_t *) this - imemoffset);

    enum dshowDeviceType devtype = pin->filter->type;

    void *priv_data;

    uint8_t *buf;

    int buf_size;

    int index;

    int64_t curtime;



    dshowdebug("libAVMemInputPin_Receive(%p)\n", this);



    if (!sample)

        return E_POINTER;



    if (devtype == VideoDevice) {

        

        IReferenceClock *clock = pin->filter->clock;

        IReferenceClock_GetTime(clock, &curtime);

    } else {

        int64_t dummy;

        IMediaSample_GetTime(sample, &curtime, &dummy);

        curtime += pin->filter->start_time;

    }



    buf_size = IMediaSample_GetActualDataLength(sample);

    IMediaSample_GetPointer(sample, &buf);

    priv_data = pin->filter->priv_data;

    index = pin->filter->stream_index;



    pin->filter->callback(priv_data, index, buf, buf_size, curtime);



    return S_OK;

}

    pin->filter->callback(priv_data, index, buf, buf_size, curtime);
FUNC_0(libAVMemInputPin *VAR_0, IMediaSample *VAR_1)

{

    libAVPin *pin = (libAVPin *) ((uint8_t *) VAR_0 - imemoffset);

    enum dshowDeviceType VAR_2 = pin->filter->type;

    void *VAR_3;

    uint8_t *buf;

    int VAR_4;

    int VAR_5;

    int64_t curtime;



    dshowdebug("FUNC_0(%p)\n", VAR_0);



    if (!VAR_1)

        return E_POINTER;



    if (VAR_2 == VideoDevice) {

        

        IReferenceClock *clock = pin->filter->clock;

        IReferenceClock_GetTime(clock, &curtime);

    } else {

        int64_t dummy;

        IMediaSample_GetTime(VAR_1, &curtime, &dummy);

        curtime += pin->filter->start_time;

    }



    VAR_4 = IMediaSample_GetActualDataLength(VAR_1);

    IMediaSample_GetPointer(VAR_1, &buf);

    VAR_3 = pin->filter->VAR_3;

    VAR_5 = pin->filter->stream_index;



    pin->filter->callback(VAR_3, VAR_5, buf, VAR_4, curtime);



    return S_OK;

}

FUNC_0(libAVMemInputPin *VAR_0, IMediaSample *VAR_1)
{ libAVPin *pin = (libAVPin *) ((uint8_t *) VAR_0 - imemoffset); enum dshowDeviceType VAR_2 = pin->filter->type; void *VAR_3; uint8_t *buf; int VAR_4; int VAR_5; int64_t curtime; dshowdebug("FUNC_0(%p)\n", VAR_0); if (!VAR_1)
return E_POINTER; if (VAR_2 == VideoDevice) { IReferenceClock *clock = pin->filter->clock; IReferenceClock_GetTime(clock, &curtime); } else { int64_t dummy; IMediaSample_GetTime(VAR_1, &curtime, &dummy); curtime += pin->filter->start_time; } VAR_4 = IMediaSample_GetActualDataLength(VAR_1); IMediaSample_GetPointer(VAR_1, &buf); VAR_3 = pin->filter->VAR_3; VAR_5 = pin->filter->stream_index; pin->filter->callback(VAR_3, VAR_5, buf, VAR_4, curtime); return S_OK; }