summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-06 16:04:26 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-10 07:29:32 +0200
commit533836b8e0e5693b3d3e8403666ce216687d51b3 (patch)
tree5ce24749b49255d4055ab6bb3519d1f7a470cce0 /libavformat/utils.c
parentba49acf143743bc9480566a52e94030cf38bfc75 (diff)
avformat/utils: Move ff_get_packet_palette() to rawutils.c
ff_get_packet_palette() and ff_reshuffle_raw_rgb() belong together: E.g. the former takes the return value of the latter as argument. So move ff_get_packet_palette() to rawutils.c (which consists solely of ff_reshuffle_raw_rgb()). Also add a separate header for these two functions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index b53e2aff0c..cc5507a19e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1715,30 +1715,6 @@ int ff_standardize_creation_time(AVFormatContext *s)
return ret;
}
-int ff_get_packet_palette(AVFormatContext *s, AVPacket *pkt, int ret, uint32_t *palette)
-{
- uint8_t *side_data;
- size_t size;
-
- side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_PALETTE, &size);
- if (side_data) {
- if (size != AVPALETTE_SIZE) {
- av_log(s, AV_LOG_ERROR, "Invalid palette side data\n");
- return AVERROR_INVALIDDATA;
- }
- memcpy(palette, side_data, AVPALETTE_SIZE);
- return 1;
- }
-
- if (ret == CONTAINS_PAL) {
- for (int i = 0; i < AVPALETTE_COUNT; i++)
- palette[i] = AV_RL32(pkt->data + pkt->size - AVPALETTE_SIZE + i*4);
- return 1;
- }
-
- return 0;
-}
-
int ff_bprint_to_codecpar_extradata(AVCodecParameters *par, struct AVBPrint *buf)
{
int ret;