Merge pull request #3346 from gpac/buildbot-av1-switch-frames

add av1 switching frames 'av1s' sample group
This commit is contained in:
Jean Le Feuvre
2025-11-21 15:59:33 +01:00
committed by GitHub
18 changed files with 200 additions and 15 deletions

View File

@@ -4867,6 +4867,19 @@ GF_Err gf_filter_pck_set_sap(GF_FilterPacket *pck, GF_FilterSAPType sap_type);
*/
GF_FilterSAPType gf_filter_pck_get_sap(GF_FilterPacket *pck);
/*! Sets packet switch frame flag
\param pck target packet
\param is_switch_frame switch frame flag of the packet
\return error code if any
*/
GF_Err gf_filter_pck_set_switch_frame(GF_FilterPacket *pck, Bool is_switch_frame);
/*! Sets packet switch frame flag
\param pck target packet
\return switch frame flag of the packet
*/
Bool gf_filter_pck_get_switch_frame(GF_FilterPacket *pck);
/*! Sets packet video interlacing flag
\param pck target packet

View File

@@ -3588,6 +3588,12 @@ typedef struct
u8 *data;
} GF_DefaultSampleGroupDescriptionEntry;
/*AV1 Switching Entry - Switching Frames*/
typedef struct
{
int unused; // C requires that a struct or union has at least one member
} GF_AV1SwitchingEntry;
/*VisualRandomAccessEntry - 'rap ' type*/
typedef struct
{

View File

@@ -932,7 +932,7 @@ typedef struct
{
Bool is_first_frame;
Bool seen_frame_header, seen_seq_header;
Bool key_frame, show_frame;
Bool key_frame, switch_frame, show_frame;
AV1FrameType frame_type;
GF_List *header_obus, *frame_obus; /*GF_AV1_OBUArrayEntry*/
AV1Tile tiles[AV1_MAX_TILE_ROWS * AV1_MAX_TILE_COLS];

View File

@@ -5071,6 +5071,16 @@ GF_Err gf_isom_fragment_set_sample_roll_group(GF_ISOFile *isom_file, GF_ISOTrack
*/
GF_Err gf_isom_fragment_set_sample_rap_group(GF_ISOFile *isom_file, GF_ISOTrackID trackID, u32 sample_number_in_frag, Bool is_rap, u32 num_leading_samples);
/*! sets AV1 Switching Frame information for a sample in a track fragment
\param isom_file the target ISO file
\param trackID the ID of the target track
\param sample_number_in_frag the sample number of the sample in the traf
\param is_rap set to GF_TRUE to indicate the sample is a RAP sample (open-GOP), GF_FALSE otherwise
\param num_leading_samples set to the number of leading pictures for a RAP sample
\return error if any
*/
GF_Err gf_isom_fragment_set_sample_av1_switch_frame_group(GF_ISOFile *isom_file, GF_ISOTrackID trackID, u32 sample_number_in_frag, Bool is_switch_Frame);
/*! sets sample dependency flags in a track fragment - see ISO/IEC 14496-12 and \ref gf_filter_pck_set_dependency_flags
\param isom_file the target ISO file
\param trackID the ID of the target track
@@ -7253,6 +7263,7 @@ enum {
GF_ISOM_SAMPLE_GROUP_VIPR = GF_4CC( 'v', 'i', 'p', 'r'), //p15
GF_ISOM_SAMPLE_GROUP_LBLI = GF_4CC( 'l', 'b', 'l', 'i'), //p15
GF_ISOM_SAMPLE_GROUP_3GAG = GF_4CC( '3', 'g', 'a', 'g'), //3gpp
GF_ISOM_SAMPLE_GROUP_AV1S = GF_4CC( 'a', 'v', '1', 's'), //av1-isobmff
GF_ISOM_SAMPLE_GROUP_AVCB = GF_4CC( 'a', 'v', 'c', 'b'), //avif
GF_ISOM_SAMPLE_GROUP_SPOR = GF_4CC( 's', 'p', 'o', 'r'), //p15
GF_ISOM_SAMPLE_GROUP_SULM = GF_4CC( 's', 'u', 'l', 'm'), //p15
@@ -7286,7 +7297,7 @@ Bool gf_isom_get_sample_group_info(GF_ISOFile *isom_file, u32 trackNumber, u32 s
\param trackNumber the target track
\param sample_number sample number to query
\param grouping_type four character code of grouping type of sample group description to query
\param grouping_type_parameter grouping type parameter of sample group description to query
\param grouping_type_parameter grouping type parameter of sample group description to query
\param sampleGroupDescIndex set to the 1-based sample group description index, or 0 if no sample group of this type is associated
\return error if any
*/
@@ -7357,6 +7368,18 @@ GF_Err gf_isom_enum_sample_aux_data(GF_ISOFile *isom_file, u32 trackNumber, u32
*/
GF_Err gf_isom_set_sample_rap_group(GF_ISOFile *isom_file, u32 trackNumber, u32 sampleNumber, Bool is_rap, u32 num_leading_samples);
/*! sets AV1 Switching Frame info for sample_number
\warning Sample group info MUST be added in order (no insertion in the tables)
\param isom_file the target ISO file
\param trackNumber the target track
\param sampleNumber the target sample number
\param is_rap indicates if the sample is a RAP (open gop) sample
\param num_leading_samples indicates the number of leading samples (samples after this RAP that have dependences on samples before this RAP and hence should be discarded when tuning in)
\return error if any
*/
GF_Err gf_isom_set_sample_av1_switch_frame_group(GF_ISOFile *isom_file, u32 trackNumber, u32 sampleNumber, Bool is_switch_Frame);
/*! sets roll_distance info for sample_number (number of frames before (<0) or after (>0) this sample to have a complete refresh of the decoded data (used by GDR in AVC)
\warning Sample group info MUST be added in order (no insertion in the tables)