47 #define OFFSET(x) offsetof(ShowInfoContext, x) 48 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM 60 double yaw, pitch, roll;
63 if (sd->
size <
sizeof(*spherical)) {
79 yaw = ((double)spherical->
yaw) / (1 << 16);
80 pitch = ((double)spherical->
pitch) / (1 << 16);
81 roll = ((double)spherical->
roll) / (1 << 16);
101 if (sd->
size <
sizeof(*stereo)) {
122 if (!roi_size || sd->
size % roi_size != 0) {
126 nb_rois = sd->
size / roi_size;
129 for (
int i = 0;
i < nb_rois;
i++) {
131 av_log(ctx,
AV_LOG_INFO,
"index: %d, region: (%d, %d)/(%d, %d), qp offset: %d/%d.\n",
173 for (i = 0; i <
len; i++) {
175 *sum2 += src[
i] * src[
i];
184 uint32_t plane_checksum[4] = {0},
checksum = 0;
185 int64_t sum[4] = {0}, sum2[4] = {0};
197 for (i = 0; i <
h; i++) {
202 pixelcount[
plane] += linesize;
208 "n:%4"PRId64
" pts:%7s pts_time:%-7s pos:%9"PRId64
" " 209 "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c ",
222 "checksum:%08"PRIX32
" plane_checksum:[%08"PRIX32,
229 av_log(ctx,
AV_LOG_INFO,
"%"PRId64
" ", (sum[plane] + pixelcount[plane]/2) / pixelcount[plane]);
233 sqrt((sum2[plane] - sum[plane]*(
double)sum[plane]/pixelcount[plane])/pixelcount[plane]));
256 uint32_t *
tc = (uint32_t*)sd->
data;
257 for (
int j = 1; j <= tc[0]; j++) {
292 is_out ?
"out" :
"in",
336 .priv_class = &showinfo_class,
int32_t pitch
Rotation around the right vector [-90, 90].
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
static int config_props_out(AVFilterLink *link)
int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)
Compute the size of an image line with format pix_fmt and width width for the plane plane...
int top
Distance in pixels from the top edge of the frame to the top and bottom edges and from the left edge ...
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
static void dump_spherical(AVFilterContext *ctx, AVFrame *frame, AVFrameSideData *sd)
int64_t pkt_pos
reordered pos from the last AVPacket that has been input into the decoder
#define AV_LOG_WARNING
Something somehow does not look correct.
Main libavfilter public API header.
int h
agreed upon image height
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection...
Timecode which conforms to SMPTE ST 12-1.
Video represents a sphere mapped on a flat surface using equirectangular projection.
static const AVFilterPad avfilter_vf_showinfo_inputs[]
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
const char * av_color_space_name(enum AVColorSpace space)
AVRational qoffset
Quantisation offset.
const char * name
Pad name.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static void dump_color_property(AVFilterContext *ctx, AVFrame *frame)
timestamp utils, mostly useful for debugging/logging purposes
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
static int config_props_in(AVFilterLink *link)
const char * av_color_range_name(enum AVColorRange range)
unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, unsigned int len)
Calculate the Adler32 checksum of a buffer.
void av_spherical_tile_bounds(const AVSphericalMapping *map, size_t width, size_t height, size_t *left, size_t *top, size_t *right, size_t *bottom)
Convert the bounding fields from an AVSphericalVideo from 0.32 fixed point to pixels.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
The data is the AVPanScan struct defined in libavcodec.
Structure to hold side data for an AVFrame.
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
int interlaced_frame
The content of the picture is interlaced.
uint32_t self_size
Must be set to the size of this data structure (that is, sizeof(AVRegionOfInterest)).
The data represents the AVSphericalMapping structure defined in libavutil/spherical.h.
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
AVFrameSideData ** side_data
A filter pad used for either input or output.
A link between two filters.
AVFILTER_DEFINE_CLASS(showinfo)
#define i(width, name, range_min, range_max)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int flags
Additional information about the frame packing.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0, will be automatically copied from the first input of the source filter if it exists.
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
enum AVColorRange color_range
MPEG vs JPEG YUV range.
ATSC A53 Part 4 Closed Captions.
static void update_sample_stats(const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
enum AVColorSpace colorspace
YUV colorspace type.
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
common internal API header
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
enum AVPictureType pict_type
Picture type of the frame.
static int config_props(AVFilterContext *ctx, AVFilterLink *link, int is_out)
static const AVOption showinfo_options[]
static void dump_stereo3d(AVFilterContext *ctx, AVFrameSideData *sd)
Structure describing a single Region Of Interest.
int32_t yaw
Rotation around the up vector [-180, 180].
AVFilterContext * src
source filter
static volatile int checksum
int format
agreed upon media format
uint32_t padding
Number of pixels to pad from the edge of each cube face.
Public header for Adler-32 hash function implementation.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
enum AVStereo3DType type
How views are packed within the video.
#define AV_LOG_INFO
Standard information.
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
static const AVFilterPad avfilter_vf_showinfo_outputs[]
Describe the class of an AVClass context structure.
int32_t roll
Rotation around the forward vector [-180, 180].
Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is ...
static void dump_roi(AVFilterContext *ctx, AVFrameSideData *sd)
const char * name
Filter name.
This structure describes how to handle spherical videos, outlining information about projection...
AVFilterLink ** outputs
array of pointers to output links
char * av_timecode_make_smpte_tc_string(char *buf, uint32_t tcsmpte, int prevent_df)
Get the timecode string from the SMPTE timecode format.
enum AVFrameSideDataType type
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
enum AVSphericalProjection projection
Projection type.
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
int top_field_first
If the content is interlaced, is top field displayed first.
#define av_ts2str(ts)
Convenience macro, the return value should be used only directly in function arguments but never stan...
AVFilterContext * dst
dest filter
int key_frame
1 -> keyframe, 0-> not
enum AVColorPrimaries color_primaries
double av_display_rotation_get(const int32_t matrix[9])
Extract the rotation component of the transformation matrix.
enum AVColorTransferCharacteristic color_trc
Stereoscopic 3d metadata.
#define AV_TIMECODE_STR_SIZE
#define AV_CEIL_RSHIFT(a, b)