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
2be0366a
Commit
2be0366a
authored
Mar 02, 2016
by
Mats Peterson
Committed by
Michael Niedermayer
Mar 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/utils: Add ff_get_packet_palette()
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
554f6e93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
internal.h
libavformat/internal.h
+12
-0
utils.c
libavformat/utils.c
+16
-0
No files found.
libavformat/internal.h
View file @
2be0366a
...
...
@@ -573,4 +573,16 @@ int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int
*/
int
ff_reshuffle_raw_rgb
(
AVFormatContext
*
s
,
AVPacket
**
ppkt
,
AVCodecContext
*
enc
,
int
expected_stride
);
/**
* Retrieves the palette from a packet, either from side data, or
* appended to the video data in the packet itself (raw video only).
* It is commonly used after a call to ff_reshuffle_raw_rgb().
*
* Use 0 for the ret parameter to check for side data only.
*
* @param pkt pointer to the packet before calling ff_reshuffle_raw_rgb()
* @param ret return value from ff_reshuffle_raw_rgb(), or 0
*/
int
ff_get_packet_palette
(
AVFormatContext
*
s
,
AVPacket
*
pkt
,
int
ret
,
const
uint8_t
**
palette
);
#endif
/* AVFORMAT_INTERNAL_H */
libavformat/utils.c
View file @
2be0366a
...
...
@@ -4759,3 +4759,19 @@ int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int
}
return
0
;
}
int
ff_get_packet_palette
(
AVFormatContext
*
s
,
AVPacket
*
pkt
,
int
ret
,
const
uint8_t
**
palette
)
{
int
size
;
*
palette
=
av_packet_get_side_data
(
pkt
,
AV_PKT_DATA_PALETTE
,
&
size
);
if
(
*
palette
&&
size
!=
AVPALETTE_SIZE
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Invalid palette side data
\n
"
);
return
AVERROR_INVALIDDATA
;
}
if
(
!*
palette
&&
ret
==
CONTAINS_PAL
)
*
palette
=
pkt
->
data
+
pkt
->
size
-
AVPALETTE_SIZE
;
return
0
;
}
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