You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/utils: Move avformat_queue_attached_pictures to demux_utils.c
AVStream.attached_pic is only used for demuxers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "libavcodec/packet_internal.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "demux.h"
|
#include "demux.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
@@ -83,3 +84,26 @@ void av_format_inject_global_side_data(AVFormatContext *s)
|
|||||||
ffstream(st)->inject_global_side_data = 1;
|
ffstream(st)->inject_global_side_data = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int avformat_queue_attached_pictures(AVFormatContext *s)
|
||||||
|
{
|
||||||
|
FFFormatContext *const si = ffformatcontext(s);
|
||||||
|
int ret;
|
||||||
|
for (unsigned i = 0; i < s->nb_streams; i++)
|
||||||
|
if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC &&
|
||||||
|
s->streams[i]->discard < AVDISCARD_ALL) {
|
||||||
|
if (s->streams[i]->attached_pic.size <= 0) {
|
||||||
|
av_log(s, AV_LOG_WARNING,
|
||||||
|
"Attached picture on stream %d has invalid size, "
|
||||||
|
"ignoring\n", i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = avpriv_packet_list_put(&si->raw_packet_buffer,
|
||||||
|
&s->streams[i]->attached_pic,
|
||||||
|
av_packet_ref, 0);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -175,29 +175,6 @@ int av_filename_number_test(const char *filename)
|
|||||||
(av_get_frame_filename(buf, sizeof(buf), filename, 1) >= 0);
|
(av_get_frame_filename(buf, sizeof(buf), filename, 1) >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int avformat_queue_attached_pictures(AVFormatContext *s)
|
|
||||||
{
|
|
||||||
FFFormatContext *const si = ffformatcontext(s);
|
|
||||||
int ret;
|
|
||||||
for (unsigned i = 0; i < s->nb_streams; i++)
|
|
||||||
if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC &&
|
|
||||||
s->streams[i]->discard < AVDISCARD_ALL) {
|
|
||||||
if (s->streams[i]->attached_pic.size <= 0) {
|
|
||||||
av_log(s, AV_LOG_WARNING,
|
|
||||||
"Attached picture on stream %d has invalid size, "
|
|
||||||
"ignoring\n", i);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = avpriv_packet_list_put(&si->raw_packet_buffer,
|
|
||||||
&s->streams[i]->attached_pic,
|
|
||||||
av_packet_ref, 0);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ff_add_attached_pic(AVFormatContext *s, AVStream *st0, AVIOContext *pb,
|
int ff_add_attached_pic(AVFormatContext *s, AVStream *st0, AVIOContext *pb,
|
||||||
AVBufferRef **buf, int size)
|
AVBufferRef **buf, int size)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user