X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavdevice%2Fdshow.c;h=8d0a6fcc09371413da14854accb73b5354150007;hb=4e8d22478bc854949a9adbda97348f2997e1dc8d;hp=d7f5bd7069ac64727aea3aafd11e0d8200dabc83;hpb=b2f32d60eeaf883bb7d9e1b8cc2fb9a983d08f72;p=ffmpeg diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index d7f5bd7069a..8d0a6fcc093 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -58,7 +58,7 @@ static int dshow_read_close(AVFormatContext *s) { struct dshow_ctx *ctx = s->priv_data; - AVPacketList *pktl; + PacketList *pktl; if (ctx->control) { IMediaControl_Stop(ctx->control); @@ -87,13 +87,13 @@ dshow_read_close(AVFormatContext *s) } 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]); @@ -118,7 +118,7 @@ dshow_read_close(AVFormatContext *s) pktl = ctx->pktl; while (pktl) { - AVPacketList *next = pktl->next; + PacketList *next = pktl->next; av_packet_unref(&pktl->pkt); av_free(pktl); pktl = next; @@ -162,7 +162,7 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, e { AVFormatContext *s = priv_data; struct dshow_ctx *ctx = s->priv_data; - AVPacketList **ppktl, *pktl_next; + PacketList **ppktl, *pktl_next; // dump_videohdr(s, vdhdr); @@ -171,7 +171,7 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, e 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; @@ -369,7 +369,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, 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 { @@ -510,7 +510,7 @@ 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) { +ff_dshow_show_filter_properties(IBaseFilter *device_filter, AVFormatContext *avctx) { ISpecifyPropertyPages *property_pages = NULL; IUnknown *device_filter_iunknown = NULL; HRESULT hr; @@ -582,7 +582,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype, 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) { @@ -731,8 +731,8 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, 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; @@ -807,7 +807,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, 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; @@ -863,7 +863,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, 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; @@ -887,7 +887,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, 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"); @@ -953,7 +953,7 @@ dshow_add_device(AVFormatContext *avctx, 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) { @@ -1262,7 +1262,7 @@ static int dshow_check_event_queue(IMediaEvent *media_event) 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); @@ -1328,7 +1328,7 @@ static const AVClass dshow_class = { .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, }; -AVInputFormat ff_dshow_demuxer = { +const AVInputFormat ff_dshow_demuxer = { .name = "dshow", .long_name = NULL_IF_CONFIG_SMALL("DirectShow capture"), .priv_data_size = sizeof(struct dshow_ctx),