]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/vfwcap.c
libavresample: Remove deprecated library
[ffmpeg] / libavdevice / vfwcap.c
index 6a923d99578028962adc7b50be62583d23c886bb..b3ef5f344818ee20e0c573ee177c74a825d7863b 100644 (file)
@@ -24,6 +24,7 @@
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
 
+#include "libavcodec/packet_internal.h"
 #include "libavformat/internal.h"
 
 // windows.h must no be included before winsock2.h, and libavformat internal
@@ -44,7 +45,7 @@ struct vfw_ctx {
     HWND hwnd;
     HANDLE mutex;
     HANDLE event;
-    AVPacketList *pktl;
+    PacketList *pktl;
     unsigned int curbufsize;
     unsigned int frame_num;
     char *video_size;       /**< A string describing video size, set by a private option. */
@@ -178,7 +179,7 @@ static LRESULT CALLBACK videostream_cb(HWND hwnd, LPVIDEOHDR vdhdr)
 {
     AVFormatContext *s;
     struct vfw_ctx *ctx;
-    AVPacketList **ppktl, *pktl_next;
+    PacketList **ppktl, *pktl_next;
 
     s = (AVFormatContext *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
     ctx = s->priv_data;
@@ -190,7 +191,7 @@ static LRESULT CALLBACK videostream_cb(HWND hwnd, LPVIDEOHDR vdhdr)
 
     WaitForSingleObject(ctx->mutex, INFINITE);
 
-    pktl_next = av_mallocz(sizeof(AVPacketList));
+    pktl_next = av_mallocz(sizeof(PacketList));
     if(!pktl_next)
         goto fail;
 
@@ -219,7 +220,7 @@ fail:
 static int vfw_read_close(AVFormatContext *s)
 {
     struct vfw_ctx *ctx = s->priv_data;
-    AVPacketList *pktl;
+    PacketList *pktl;
 
     if(ctx->hwnd) {
         SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
@@ -233,7 +234,7 @@ static int vfw_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;
@@ -328,11 +329,14 @@ static int vfw_read_header(AVFormatContext *s)
     }
 
     if (ctx->video_size) {
-        ret = av_parse_video_size(&bi->bmiHeader.biWidth, &bi->bmiHeader.biHeight, ctx->video_size);
+        int w, h;
+        ret = av_parse_video_size(&w, &h, ctx->video_size);
         if (ret < 0) {
             av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n");
             goto fail;
         }
+        bi->bmiHeader.biWidth  = w;
+        bi->bmiHeader.biHeight = h;
     }
 
     if (0) {
@@ -436,7 +440,7 @@ fail:
 static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     struct vfw_ctx *ctx = s->priv_data;
-    AVPacketList *pktl = NULL;
+    PacketList *pktl = NULL;
 
     while(!pktl) {
         WaitForSingleObject(ctx->mutex, INFINITE);