History

Separate video specific BufferRef properties into VideoProps.

Define a new struct AVFilterBufferRefVideoProps and add a type field to AVFilterBufferRef. Video specific properties in AVFilterBufferRefVideoProps are now referred to by *video pointer in AVFilterBufferRef. Patch by S.N. Hemanth Meenakshisundaram smeenaks->ucsd.edu. Originally committed as revision 24763 to svn://svn.ffmpeg.org/ffmpeg/trunk

S.N. Hemanth Meenakshisundaram committed 16 years ago

Commit cc80caf1 parent fd7b11d10 files · +59 −42Browse files

Showing the changes to libavfilter/avfilter.h (1 of 10 files). Show all

Unified · Split

libavfilter/avfilter.h+22−12
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include "libavutil/avutil.h"
2626
2727 #define LIBAVFILTER_VERSION_MAJOR 1
28−#define LIBAVFILTER_VERSION_MINOR 31
28+#define LIBAVFILTER_VERSION_MINOR 32
2929 #define LIBAVFILTER_VERSION_MICRO 0
3030
3131 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -88,6 +88,20 @@ typedef struct AVFilterBuffer · 56 unmodified lines
8888 #define AV_PERM_REUSE 0x08 ///< can output the buffer multiple times, with the same contents each time
8989 #define AV_PERM_REUSE2 0x10 ///< can output the buffer multiple times, modified each time
9090
91+/**
92+ * Video specific properties in a reference to an AVFilterBuffer. Since
93+ * AVFilterBufferRef is common to different media formats, video specific
94+ * per reference properties must be separated out.
95+ */
96+typedef struct AVFilterBufferRefVideoProps
97+{
98+ int w; ///< image width
99+ int h; ///< image height
100+ AVRational pixel_aspect; ///< pixel aspect ratio
101+ int interlaced; ///< is frame interlaced
102+ int top_field_first; ///< field order
103+} AVFilterBufferRefVideoProps;
104+
91105 /**
92106 * A reference to an AVFilterBuffer. Since filters can manipulate the origin of
93107 * a buffer to, for example, crop image without any memcpy, the buffer origin
@@ -101,19 +115,15 @@ typedef struct AVFilterBufferRef · 7 unmodified lines
101115 AVFilterBuffer *buf; ///< the buffer that this is a reference to
102116 uint8_t *data[4]; ///< picture data for each plane
103117 int linesize[4]; ///< number of bytes per line
104− int w; ///< image width
105− int h; ///< image height
106118 int format; ///< media format
107119
108120 int64_t pts; ///< presentation timestamp in units of 1/AV_TIME_BASE
109121 int64_t pos; ///< byte position in stream, -1 if unknown
110122
111− AVRational pixel_aspect; ///< pixel aspect ratio
112−
113123 int perms; ///< permissions, see the AV_PERM_* flags
114124
115− int interlaced; ///< is frame interlaced
116− int top_field_first;
125+ enum AVMediaType type; ///< media type of buffer data
126+ AVFilterBufferRefVideoProps *video; ///< video buffer specific properties
117127 } AVFilterBufferRef;
118128
119129 /**
@@ -122,13 +132,13 @@ typedef struct AVFilterBufferRef · 2 unmodified lines
122132 */
123133 static inline void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
124134 {
135+ // copy common properties
125136 dst->pts = src->pts;
126137 dst->pos = src->pos;
127− dst->pixel_aspect = src->pixel_aspect;
128− dst->interlaced = src->interlaced;
129− dst->top_field_first = src->top_field_first;
130− dst->w = src->w;
131− dst->h = src->h;
138+
139+ switch (src->type) {
140+ case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break;
141+ }
132142 }
133143
134144 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t