FFmpeg  4.3
Data Structures | Macros | Typedefs | Functions
qt-faststart.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#include <limits.h>

Go to the source code of this file.

Data Structures

struct  atom_t
 
struct  update_chunk_offsets_context_t
 
struct  upgrade_stco_context_t
 

Macros

#define MIN(a, b)   ((a) > (b) ? (b) : (a))
 
#define BE_32(x)
 
#define BE_64(x)
 
#define AV_WB32(p, val)
 
#define AV_WB64(p, val)
 
#define BE_FOURCC(ch0, ch1, ch2, ch3)
 
#define QT_ATOM   BE_FOURCC
 
#define FREE_ATOM   QT_ATOM('f', 'r', 'e', 'e')
 
#define JUNK_ATOM   QT_ATOM('j', 'u', 'n', 'k')
 
#define MDAT_ATOM   QT_ATOM('m', 'd', 'a', 't')
 
#define MOOV_ATOM   QT_ATOM('m', 'o', 'o', 'v')
 
#define PNOT_ATOM   QT_ATOM('p', 'n', 'o', 't')
 
#define SKIP_ATOM   QT_ATOM('s', 'k', 'i', 'p')
 
#define WIDE_ATOM   QT_ATOM('w', 'i', 'd', 'e')
 
#define PICT_ATOM   QT_ATOM('P', 'I', 'C', 'T')
 
#define FTYP_ATOM   QT_ATOM('f', 't', 'y', 'p')
 
#define UUID_ATOM   QT_ATOM('u', 'u', 'i', 'd')
 
#define CMOV_ATOM   QT_ATOM('c', 'm', 'o', 'v')
 
#define TRAK_ATOM   QT_ATOM('t', 'r', 'a', 'k')
 
#define MDIA_ATOM   QT_ATOM('m', 'd', 'i', 'a')
 
#define MINF_ATOM   QT_ATOM('m', 'i', 'n', 'f')
 
#define STBL_ATOM   QT_ATOM('s', 't', 'b', 'l')
 
#define STCO_ATOM   QT_ATOM('s', 't', 'c', 'o')
 
#define CO64_ATOM   QT_ATOM('c', 'o', '6', '4')
 
#define ATOM_PREAMBLE_SIZE   8
 
#define COPY_BUFFER_SIZE   33554432
 
#define MAX_FTYP_ATOM_SIZE   1048576
 

Typedefs

typedef int(* parse_atoms_callback_t) (void *context, atom_t *atom)
 

Functions

static int parse_atoms (unsigned char *buf, uint64_t size, parse_atoms_callback_t callback, void *context)
 
static int update_stco_offsets (update_chunk_offsets_context_t *context, atom_t *atom)
 
static int update_co64_offsets (update_chunk_offsets_context_t *context, atom_t *atom)
 
static int update_chunk_offsets_callback (void *ctx, atom_t *atom)
 
static void set_atom_size (unsigned char *header, uint32_t header_size, uint64_t size)
 
static void upgrade_stco_atom (upgrade_stco_context_t *context, atom_t *atom)
 
static int upgrade_stco_callback (void *ctx, atom_t *atom)
 
static int update_moov_atom (unsigned char **moov_atom, uint64_t *moov_atom_size)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ MIN

#define MIN (   a,
  b 
)    ((a) > (b) ? (b) : (a))

Definition at line 45 of file qt-faststart.c.

◆ BE_32

#define BE_32 (   x)
Value:
(((uint32_t)(((uint8_t*)(x))[0]) << 24) | \
(((uint8_t*)(x))[1] << 16) | \
(((uint8_t*)(x))[2] << 8) | \
((uint8_t*)(x))[3])

Definition at line 47 of file qt-faststart.c.

◆ BE_64

#define BE_64 (   x)
Value:
(((uint64_t)(((uint8_t*)(x))[0]) << 56) | \
((uint64_t)(((uint8_t*)(x))[1]) << 48) | \
((uint64_t)(((uint8_t*)(x))[2]) << 40) | \
((uint64_t)(((uint8_t*)(x))[3]) << 32) | \
((uint64_t)(((uint8_t*)(x))[4]) << 24) | \
((uint64_t)(((uint8_t*)(x))[5]) << 16) | \
((uint64_t)(((uint8_t*)(x))[6]) << 8) | \
((uint64_t)( (uint8_t*)(x))[7]))

Definition at line 52 of file qt-faststart.c.

◆ AV_WB32

#define AV_WB32 (   p,
  val 
)
Value:
{ \
((uint8_t*)(p))[0] = ((val) >> 24) & 0xff; \
((uint8_t*)(p))[1] = ((val) >> 16) & 0xff; \
((uint8_t*)(p))[2] = ((val) >> 8) & 0xff; \
((uint8_t*)(p))[3] = (val) & 0xff; \
}

Definition at line 61 of file qt-faststart.c.

◆ AV_WB64

#define AV_WB64 (   p,
  val 
)
Value:
{ \
AV_WB32(p, (val) >> 32) \
AV_WB32(p + 4, val) \
}

Definition at line 68 of file qt-faststart.c.

◆ BE_FOURCC

#define BE_FOURCC (   ch0,
  ch1,
  ch2,
  ch3 
)
Value:
( (uint32_t)(unsigned char)(ch3) | \
((uint32_t)(unsigned char)(ch2) << 8) | \
((uint32_t)(unsigned char)(ch1) << 16) | \
((uint32_t)(unsigned char)(ch0) << 24) )

Definition at line 73 of file qt-faststart.c.

◆ QT_ATOM

#define QT_ATOM   BE_FOURCC

Definition at line 79 of file qt-faststart.c.

◆ FREE_ATOM

#define FREE_ATOM   QT_ATOM('f', 'r', 'e', 'e')

Definition at line 81 of file qt-faststart.c.

◆ JUNK_ATOM

#define JUNK_ATOM   QT_ATOM('j', 'u', 'n', 'k')

Definition at line 82 of file qt-faststart.c.

◆ MDAT_ATOM

#define MDAT_ATOM   QT_ATOM('m', 'd', 'a', 't')

Definition at line 83 of file qt-faststart.c.

◆ MOOV_ATOM

#define MOOV_ATOM   QT_ATOM('m', 'o', 'o', 'v')

Definition at line 84 of file qt-faststart.c.

◆ PNOT_ATOM

#define PNOT_ATOM   QT_ATOM('p', 'n', 'o', 't')

Definition at line 85 of file qt-faststart.c.

◆ SKIP_ATOM

#define SKIP_ATOM   QT_ATOM('s', 'k', 'i', 'p')

Definition at line 86 of file qt-faststart.c.

◆ WIDE_ATOM

#define WIDE_ATOM   QT_ATOM('w', 'i', 'd', 'e')

Definition at line 87 of file qt-faststart.c.

◆ PICT_ATOM

#define PICT_ATOM   QT_ATOM('P', 'I', 'C', 'T')

Definition at line 88 of file qt-faststart.c.

◆ FTYP_ATOM

#define FTYP_ATOM   QT_ATOM('f', 't', 'y', 'p')

Definition at line 89 of file qt-faststart.c.

◆ UUID_ATOM

#define UUID_ATOM   QT_ATOM('u', 'u', 'i', 'd')

Definition at line 90 of file qt-faststart.c.

◆ CMOV_ATOM

#define CMOV_ATOM   QT_ATOM('c', 'm', 'o', 'v')

Definition at line 92 of file qt-faststart.c.

◆ TRAK_ATOM

#define TRAK_ATOM   QT_ATOM('t', 'r', 'a', 'k')

Definition at line 93 of file qt-faststart.c.

◆ MDIA_ATOM

#define MDIA_ATOM   QT_ATOM('m', 'd', 'i', 'a')

Definition at line 94 of file qt-faststart.c.

◆ MINF_ATOM

#define MINF_ATOM   QT_ATOM('m', 'i', 'n', 'f')

Definition at line 95 of file qt-faststart.c.

◆ STBL_ATOM

#define STBL_ATOM   QT_ATOM('s', 't', 'b', 'l')

Definition at line 96 of file qt-faststart.c.

◆ STCO_ATOM

#define STCO_ATOM   QT_ATOM('s', 't', 'c', 'o')

Definition at line 97 of file qt-faststart.c.

◆ CO64_ATOM

#define CO64_ATOM   QT_ATOM('c', 'o', '6', '4')

Definition at line 98 of file qt-faststart.c.

◆ ATOM_PREAMBLE_SIZE

#define ATOM_PREAMBLE_SIZE   8

Definition at line 100 of file qt-faststart.c.

◆ COPY_BUFFER_SIZE

#define COPY_BUFFER_SIZE   33554432

Definition at line 101 of file qt-faststart.c.

◆ MAX_FTYP_ATOM_SIZE

#define MAX_FTYP_ATOM_SIZE   1048576

Definition at line 102 of file qt-faststart.c.

Typedef Documentation

◆ parse_atoms_callback_t

typedef int(* parse_atoms_callback_t) (void *context, atom_t *atom)

Definition at line 125 of file qt-faststart.c.

Function Documentation

◆ parse_atoms()

static int parse_atoms ( unsigned char *  buf,
uint64_t  size,
parse_atoms_callback_t  callback,
void context 
)
static

◆ update_stco_offsets()

static int update_stco_offsets ( update_chunk_offsets_context_t context,
atom_t atom 
)
static

Definition at line 185 of file qt-faststart.c.

Referenced by update_chunk_offsets_callback().

◆ update_co64_offsets()

static int update_co64_offsets ( update_chunk_offsets_context_t context,
atom_t atom 
)
static

Definition at line 221 of file qt-faststart.c.

Referenced by update_chunk_offsets_callback().

◆ update_chunk_offsets_callback()

static int update_chunk_offsets_callback ( void ctx,
atom_t atom 
)
static

Definition at line 251 of file qt-faststart.c.

Referenced by update_moov_atom().

◆ set_atom_size()

static void set_atom_size ( unsigned char *  header,
uint32_t  header_size,
uint64_t  size 
)
static

Definition at line 286 of file qt-faststart.c.

Referenced by upgrade_stco_atom(), and upgrade_stco_callback().

◆ upgrade_stco_atom()

static void upgrade_stco_atom ( upgrade_stco_context_t context,
atom_t atom 
)
static

Definition at line 299 of file qt-faststart.c.

Referenced by upgrade_stco_callback().

◆ upgrade_stco_callback()

static int upgrade_stco_callback ( void ctx,
atom_t atom 
)
static

Definition at line 328 of file qt-faststart.c.

Referenced by update_moov_atom().

◆ update_moov_atom()

static int update_moov_atom ( unsigned char **  moov_atom,
uint64_t *  moov_atom_size 
)
static

Definition at line 372 of file qt-faststart.c.

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 430 of file qt-faststart.c.

x
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
Definition: fate.txt:150
val
static double val(void *priv, double ch)
Definition: aeval.c:76
uint8_t
uint8_t
Definition: audio_convert.c:194