Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a72b61a3
Commit
a72b61a3
authored
May 02, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffprobe: support printing AVStream and AVPacket side data
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
08152f2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
2 deletions
+66
-2
ffprobe.xsd
doc/ffprobe.xsd
+19
-0
ffprobe.c
ffprobe.c
+47
-2
No files found.
doc/ffprobe.xsd
View file @
a72b61a3
...
...
@@ -48,6 +48,11 @@
</xsd:complexType>
<xsd:complexType
name=
"packetType"
>
<xsd:sequence>
<xsd:element
name=
"tag"
type=
"ffprobe:tagType"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<xsd:element
name=
"side_data_list"
type=
"ffprobe:packetSideDataListType"
minOccurs=
"0"
maxOccurs=
"1"
/>
</xsd:sequence>
<xsd:attribute
name=
"codec_type"
type=
"xsd:string"
use=
"required"
/>
<xsd:attribute
name=
"stream_index"
type=
"xsd:int"
use=
"required"
/>
<xsd:attribute
name=
"pts"
type=
"xsd:long"
/>
...
...
@@ -65,6 +70,16 @@
<xsd:attribute
name=
"data_hash"
type=
"xsd:string"
/>
</xsd:complexType>
<xsd:complexType
name=
"packetSideDataListType"
>
<xsd:sequence>
<xsd:element
name=
"side_data"
type=
"ffprobe:packetSideDataType"
minOccurs=
"1"
maxOccurs=
"unbounded"
/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType
name=
"packetSideDataType"
>
<xsd:attribute
name=
"side_data_type"
type=
"xsd:string"
/>
<xsd:attribute
name=
"side_data_size"
type=
"xsd:int"
/>
</xsd:complexType>
<xsd:complexType
name=
"frameType"
>
<xsd:sequence>
<xsd:element
name=
"tag"
type=
"ffprobe:tagType"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
...
...
@@ -156,6 +171,10 @@
<xsd:element
name=
"disposition"
type=
"ffprobe:streamDispositionType"
minOccurs=
"0"
maxOccurs=
"1"
/>
<xsd:element
name=
"tag"
type=
"ffprobe:tagType"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
</xsd:sequence>
<xsd:sequence>
<xsd:element
name=
"tag"
type=
"ffprobe:tagType"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<xsd:element
name=
"side_data_list"
type=
"ffprobe:packetSideDataListType"
minOccurs=
"0"
maxOccurs=
"1"
/>
</xsd:sequence>
<xsd:attribute
name=
"index"
type=
"xsd:int"
use=
"required"
/>
<xsd:attribute
name=
"codec_name"
type=
"xsd:string"
/>
...
...
ffprobe.c
View file @
a72b61a3
...
...
@@ -137,6 +137,8 @@ typedef enum {
SECTION_ID_PACKET
,
SECTION_ID_PACKETS
,
SECTION_ID_PACKETS_AND_FRAMES
,
SECTION_ID_PACKET_SIDE_DATA_LIST
,
SECTION_ID_PACKET_SIDE_DATA
,
SECTION_ID_PIXEL_FORMAT
,
SECTION_ID_PIXEL_FORMAT_FLAGS
,
SECTION_ID_PIXEL_FORMAT_COMPONENT
,
...
...
@@ -155,6 +157,8 @@ typedef enum {
SECTION_ID_STREAM_DISPOSITION
,
SECTION_ID_STREAMS
,
SECTION_ID_STREAM_TAGS
,
SECTION_ID_STREAM_SIDE_DATA_LIST
,
SECTION_ID_STREAM_SIDE_DATA
,
SECTION_ID_SUBTITLE
,
}
SectionID
;
...
...
@@ -174,7 +178,9 @@ static struct section sections[] = {
[
SECTION_ID_LIBRARY_VERSION
]
=
{
SECTION_ID_LIBRARY_VERSION
,
"library_version"
,
0
,
{
-
1
}
},
[
SECTION_ID_PACKETS
]
=
{
SECTION_ID_PACKETS
,
"packets"
,
SECTION_FLAG_IS_ARRAY
,
{
SECTION_ID_PACKET
,
-
1
}
},
[
SECTION_ID_PACKETS_AND_FRAMES
]
=
{
SECTION_ID_PACKETS_AND_FRAMES
,
"packets_and_frames"
,
SECTION_FLAG_IS_ARRAY
,
{
SECTION_ID_PACKET
,
-
1
}
},
[
SECTION_ID_PACKET
]
=
{
SECTION_ID_PACKET
,
"packet"
,
0
,
{
-
1
}
},
[
SECTION_ID_PACKET
]
=
{
SECTION_ID_PACKET
,
"packet"
,
0
,
{
SECTION_ID_PACKET_SIDE_DATA_LIST
,
-
1
}
},
[
SECTION_ID_PACKET_SIDE_DATA_LIST
]
=
{
SECTION_ID_PACKET_SIDE_DATA_LIST
,
"side_data_list"
,
SECTION_FLAG_IS_ARRAY
,
{
SECTION_ID_PACKET_SIDE_DATA
,
-
1
}
},
[
SECTION_ID_PACKET_SIDE_DATA
]
=
{
SECTION_ID_PACKET_SIDE_DATA
,
"side_data"
,
0
,
{
-
1
}
},
[
SECTION_ID_PIXEL_FORMATS
]
=
{
SECTION_ID_PIXEL_FORMATS
,
"pixel_formats"
,
SECTION_FLAG_IS_ARRAY
,
{
SECTION_ID_PIXEL_FORMAT
,
-
1
}
},
[
SECTION_ID_PIXEL_FORMAT
]
=
{
SECTION_ID_PIXEL_FORMAT
,
"pixel_format"
,
0
,
{
SECTION_ID_PIXEL_FORMAT_FLAGS
,
SECTION_ID_PIXEL_FORMAT_COMPONENTS
,
-
1
}
},
[
SECTION_ID_PIXEL_FORMAT_FLAGS
]
=
{
SECTION_ID_PIXEL_FORMAT_FLAGS
,
"flags"
,
0
,
{
-
1
},
.
unique_name
=
"pixel_format_flags"
},
...
...
@@ -193,9 +199,11 @@ static struct section sections[] = {
SECTION_ID_PACKETS
,
SECTION_ID_ERROR
,
SECTION_ID_PROGRAM_VERSION
,
SECTION_ID_LIBRARY_VERSIONS
,
SECTION_ID_PIXEL_FORMATS
,
-
1
}
},
[
SECTION_ID_STREAMS
]
=
{
SECTION_ID_STREAMS
,
"streams"
,
SECTION_FLAG_IS_ARRAY
,
{
SECTION_ID_STREAM
,
-
1
}
},
[
SECTION_ID_STREAM
]
=
{
SECTION_ID_STREAM
,
"stream"
,
0
,
{
SECTION_ID_STREAM_DISPOSITION
,
SECTION_ID_STREAM_TAGS
,
-
1
}
},
[
SECTION_ID_STREAM
]
=
{
SECTION_ID_STREAM
,
"stream"
,
0
,
{
SECTION_ID_STREAM_DISPOSITION
,
SECTION_ID_STREAM_TAGS
,
SECTION_ID_STREAM_SIDE_DATA_LIST
,
-
1
}
},
[
SECTION_ID_STREAM_DISPOSITION
]
=
{
SECTION_ID_STREAM_DISPOSITION
,
"disposition"
,
0
,
{
-
1
},
.
unique_name
=
"stream_disposition"
},
[
SECTION_ID_STREAM_TAGS
]
=
{
SECTION_ID_STREAM_TAGS
,
"tags"
,
SECTION_FLAG_HAS_VARIABLE_FIELDS
,
{
-
1
},
.
element_name
=
"tag"
,
.
unique_name
=
"stream_tags"
},
[
SECTION_ID_STREAM_SIDE_DATA_LIST
]
=
{
SECTION_ID_STREAM_SIDE_DATA_LIST
,
"side_data_list"
,
SECTION_FLAG_IS_ARRAY
,
{
SECTION_ID_STREAM_SIDE_DATA
,
-
1
}
},
[
SECTION_ID_STREAM_SIDE_DATA
]
=
{
SECTION_ID_STREAM_SIDE_DATA
,
"side_data"
,
0
,
{
-
1
}
},
[
SECTION_ID_SUBTITLE
]
=
{
SECTION_ID_SUBTITLE
,
"subtitle"
,
0
,
{
-
1
}
},
};
...
...
@@ -1751,6 +1759,25 @@ static void show_packet(WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pk
if
(
pkt
->
pos
!=
-
1
)
print_fmt
(
"pos"
,
"%"
PRId64
,
pkt
->
pos
);
else
print_str_opt
(
"pos"
,
"N/A"
);
print_fmt
(
"flags"
,
"%c"
,
pkt
->
flags
&
AV_PKT_FLAG_KEY
?
'K'
:
'_'
);
if
(
pkt
->
side_data_elems
)
{
int
i
;
writer_print_section_header
(
w
,
SECTION_ID_PACKET_SIDE_DATA_LIST
);
for
(
i
=
0
;
i
<
pkt
->
side_data_elems
;
i
++
)
{
AVPacketSideData
*
sd
=
&
pkt
->
side_data
[
i
];
const
char
*
name
;
writer_print_section_header
(
w
,
SECTION_ID_PACKET_SIDE_DATA
);
print_str
(
"side_data_type"
,
"unknown"
);
print_int
(
"side_data_size"
,
sd
->
size
);
if
(
sd
->
type
==
AV_PKT_DATA_DISPLAYMATRIX
&&
sd
->
size
>=
9
*
4
)
{
writer_print_integers
(
w
,
"displaymatrix"
,
sd
->
data
,
9
,
" %11d"
,
3
,
4
,
1
);
print_int
(
"rotation"
,
av_display_rotation_get
((
int32_t
*
)
sd
->
data
));
}
writer_print_section_footer
(
w
);
}
writer_print_section_footer
(
w
);
}
if
(
do_show_data
)
writer_print_data
(
w
,
"data"
,
pkt
->
data
,
pkt
->
size
);
writer_print_data_hash
(
w
,
"data_hash"
,
pkt
->
data
,
pkt
->
size
);
...
...
@@ -2274,6 +2301,24 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
if
(
do_show_stream_tags
)
ret
=
show_tags
(
w
,
stream
->
metadata
,
in_program
?
SECTION_ID_PROGRAM_STREAM_TAGS
:
SECTION_ID_STREAM_TAGS
);
if
(
stream
->
nb_side_data
)
{
int
i
;
writer_print_section_header
(
w
,
SECTION_ID_STREAM_SIDE_DATA_LIST
);
for
(
i
=
0
;
i
<
stream
->
nb_side_data
;
i
++
)
{
AVPacketSideData
*
sd
=
&
stream
->
side_data
[
i
];
const
char
*
name
;
writer_print_section_header
(
w
,
SECTION_ID_STREAM_SIDE_DATA
);
print_str
(
"side_data_type"
,
"unknown"
);
print_int
(
"side_data_size"
,
sd
->
size
);
if
(
sd
->
type
==
AV_PKT_DATA_DISPLAYMATRIX
&&
sd
->
size
>=
9
*
4
)
{
writer_print_integers
(
w
,
"displaymatrix"
,
sd
->
data
,
9
,
" %11d"
,
3
,
4
,
1
);
print_int
(
"rotation"
,
av_display_rotation_get
((
int32_t
*
)
sd
->
data
));
}
writer_print_section_footer
(
w
);
}
writer_print_section_footer
(
w
);
}
writer_print_section_footer
(
w
);
av_bprint_finalize
(
&
pbuf
,
NULL
);
fflush
(
stdout
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment