|
FFmpeg
|
#include <errno.h>#include <inttypes.h>#include <limits.h>#include <stdint.h>#include <stdio.h>#include <string.h>#include "libavutil/error.h"#include "libavutil/file_open.h"#include "libavutil/intreadwrite.h"#include "libavutil/log.h"#include "libavutil/mem.h"#include "libavutil/opt.h"#include "libavcodec/bsf.h"#include "libavcodec/bsf_internal.h"#include "libavcodec/mjpeg.h"Go to the source code of this file.
Data Structures | |
| struct | JPEGAppContext |
Macros | |
| #define | JPEGAPP_MAX_RECORD (16 * 1024 * 1024) |
| Sidecar format (big-endian), one record per encoded JPEG packet: | |
| #define | OFFSET(x) |
| #define | FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_BSF_PARAM) |
Functions | |
| static int | jpeg_app_segment_len (const uint8_t *data, int size) |
| static int | jpegapp_validate_payload (const uint8_t *data, int size) |
| static int | jpegapp_init (AVBSFContext *ctx) |
| static void | jpegapp_close (AVBSFContext *ctx) |
| static int | jpegapp_read_record (AVBSFContext *ctx, int *out_size) |
| static int | jpegapp_filter (AVBSFContext *ctx, AVPacket *out) |
Variables | |
| static const AVOption | jpegapp_options [] |
| static const AVClass | jpegapp_class |
| static enum AVCodecID | jpegapp_codec_ids [] |
| const FFBitStreamFilter | ff_jpegapp_bsf |
| #define JPEGAPP_MAX_RECORD (16 * 1024 * 1024) |
Sidecar format (big-endian), one record per encoded JPEG packet:
u32be length u8 payload[length]
Payload is zero or more complete JPEG APP segments (APP0..APP15), each FF En + 16-bit length (length includes those two bytes). A zero length leaves the packet unchanged.
After SOI the payload is inserted. If it starts with APP0 and the two bytes immediately after SOI are an APP0 marker, that segment is dropped so the sidecar can replace it. An APP0 preceded by fill bytes or another segment is retained. An APP1-only payload keeps the encoder APP0: SOI, APP1, APP0, DQT, ...
A sidecar read or validation error stops further record consumption for this filter context. Flushing does not clear that error.
Definition at line 61 of file jpegapp.c.
Referenced by jpegapp_read_record().
| #define OFFSET | ( | x | ) |
| #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_BSF_PARAM) |
|
static |
Definition at line 73 of file jpegapp.c.
Referenced by jpegapp_filter(), and jpegapp_validate_payload().
|
static |
Definition at line 85 of file jpegapp.c.
Referenced by jpegapp_read_record().
|
static |
|
static |
|
static |
Definition at line 129 of file jpegapp.c.
Referenced by jpegapp_filter().
|
static |
|
static |
|
static |
|
static |
| const FFBitStreamFilter ff_jpegapp_bsf |