summaryrefslogtreecommitdiff
path: root/libavdevice/vfwcap.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-03-05 11:26:24 -0300
committerJames Almer <jamrial@gmail.com>2021-03-17 14:12:17 -0300
commitd422b2ed87ee7d3b3014cd3fac553e6aad7d4f14 (patch)
tree06b1f9e88cfab2675afd529468f47ab851f1bab3 /libavdevice/vfwcap.c
parentf7db77bd8785d1715d3e7ed7e69bd1cc991f2d07 (diff)
avcodec/packet_internal: make avpriv_packet_list_* functions use an internal struct
The next pointer is kept at the end for backwards compatability until the major bump, when it should ideally be moved at the front. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavdevice/vfwcap.c')
-rw-r--r--libavdevice/vfwcap.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c
index e2ab276c2e..b3ef5f3448 100644
--- a/libavdevice/vfwcap.c
+++ b/libavdevice/vfwcap.c
@@ -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;
@@ -439,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);