dshow_read_close(AVFormatContext *s)
{
struct dshow_ctx *ctx = s->priv_data;
- AVPacketList *pktl;
+ PacketList *pktl;
if (ctx->control) {
IMediaControl_Stop(ctx->control);
}
if (ctx->capture_pin[VideoDevice])
- libAVPin_Release(ctx->capture_pin[VideoDevice]);
+ ff_dshow_pin_Release(ctx->capture_pin[VideoDevice]);
if (ctx->capture_pin[AudioDevice])
- libAVPin_Release(ctx->capture_pin[AudioDevice]);
+ ff_dshow_pin_Release(ctx->capture_pin[AudioDevice]);
if (ctx->capture_filter[VideoDevice])
- libAVFilter_Release(ctx->capture_filter[VideoDevice]);
+ ff_dshow_filter_Release(ctx->capture_filter[VideoDevice]);
if (ctx->capture_filter[AudioDevice])
- libAVFilter_Release(ctx->capture_filter[AudioDevice]);
+ ff_dshow_filter_Release(ctx->capture_filter[AudioDevice]);
if (ctx->device_pin[VideoDevice])
IPin_Release(ctx->device_pin[VideoDevice]);
pktl = ctx->pktl;
while (pktl) {
- AVPacketList *next = pktl->next;
+ PacketList *next = pktl->next;
av_packet_unref(&pktl->pkt);
av_free(pktl);
pktl = next;
{
AVFormatContext *s = priv_data;
struct dshow_ctx *ctx = s->priv_data;
- AVPacketList **ppktl, *pktl_next;
+ PacketList **ppktl, *pktl_next;
// dump_videohdr(s, vdhdr);
if(shall_we_drop(s, index, devtype))
goto fail;
- pktl_next = av_mallocz(sizeof(AVPacketList));
+ pktl_next = av_mallocz(sizeof(PacketList));
if(!pktl_next)
goto fail;
enum AVPixelFormat pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount);
if (pix_fmt == AV_PIX_FMT_NONE) {
enum AVCodecID codec_id = av_codec_get_id(tags, bih->biCompression);
- AVCodec *codec = avcodec_find_decoder(codec_id);
+ const AVCodec *codec = avcodec_find_decoder(codec_id);
if (codec_id == AV_CODEC_ID_NONE || !codec) {
av_log(avctx, AV_LOG_INFO, " unknown compression type 0x%X", (int) bih->biCompression);
} else {
* 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) {
+ff_dshow_show_filter_properties(IBaseFilter *device_filter, AVFormatContext *avctx) {
ISpecifyPropertyPages *property_pages = NULL;
IUnknown *device_filter_iunknown = NULL;
HRESULT hr;
int should_show_properties = (devtype == VideoDevice) ? ctx->show_video_device_dialog : ctx->show_audio_device_dialog;
if (should_show_properties)
- dshow_show_filter_properties(device_filter, avctx);
+ ff_dshow_show_filter_properties(device_filter, avctx);
r = IBaseFilter_EnumPins(device_filter, &pins);
if (r != S_OK) {
char *device_filter_unique_name = NULL;
IGraphBuilder *graph = ctx->graph;
IPin *device_pin = NULL;
- libAVPin *capture_pin = NULL;
- libAVFilter *capture_filter = NULL;
+ DShowPin *capture_pin = NULL;
+ DShowFilter *capture_filter = NULL;
ICaptureGraphBuilder2 *graph_builder2 = NULL;
int ret = AVERROR(EIO);
int r;
ctx->device_pin[devtype] = device_pin;
- capture_filter = libAVFilter_Create(avctx, callback, devtype);
+ capture_filter = ff_dshow_filter_Create(avctx, callback, devtype);
if (!capture_filter) {
av_log(avctx, AV_LOG_ERROR, "Could not create grabber filter.\n");
goto error;
goto error;
}
- libAVPin_AddRef(capture_filter->pin);
+ ff_dshow_pin_AddRef(capture_filter->pin);
capture_pin = capture_filter->pin;
ctx->capture_pin[devtype] = capture_pin;
goto error;
}
- r = dshow_try_setup_crossbar_options(graph_builder2, device_filter, devtype, avctx);
+ r = ff_dshow_try_setup_crossbar_options(graph_builder2, device_filter, devtype, avctx);
if (r != S_OK) {
av_log(avctx, AV_LOG_ERROR, "Could not setup CrossBar\n");
ctx->capture_filter[devtype]->stream_index = st->index;
- libAVPin_ConnectionMediaType(ctx->capture_pin[devtype], &type);
+ ff_dshow_pin_ConnectionMediaType(ctx->capture_pin[devtype], &type);
par = st->codecpar;
if (devtype == VideoDevice) {
static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
{
struct dshow_ctx *ctx = s->priv_data;
- AVPacketList *pktl = NULL;
+ PacketList *pktl = NULL;
while (!ctx->eof && !pktl) {
WaitForSingleObject(ctx->mutex, INFINITE);