本文整理汇总了C++中write_atom_header函数的典型用法代码示例。如果您正苦于以下问题:C++ write_atom_header函数的具体用法?C++ write_atom_header怎么用?C++ write_atom_header使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了write_atom_header函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mss_write_uuid_tfrf_atom
static u_char*
mss_write_uuid_tfrf_atom(u_char* p, segment_timing_info_t* timing_info)
{
size_t atom_size = TFRF_ATOM_SIZE;
uint64_t timestamp;
uint64_t duration;
int i;
timestamp = timing_info->timestamp;
duration = timing_info->duration;
write_atom_header(p, atom_size, 'u', 'u', 'i', 'd');
p = vod_copy(p, tfrf_uuid, sizeof(tfrf_uuid));
write_be32(p, 0x01000000); // version / flags
*p++ = MSS_LOOK_AHEAD_COUNT;
for (i = 0; i < MSS_LOOK_AHEAD_COUNT; i++)
{
timestamp += duration;
write_be64(p, timestamp);
write_be64(p, duration);
}
return p;
}
示例2: edash_packager_passthrough_write_encryption_atoms
static u_char*
edash_packager_passthrough_write_encryption_atoms(void* ctx, u_char* p, size_t mdat_atom_start)
{
mp4_encrypt_passthrough_context_t* context = ctx;
media_clip_filtered_t* cur_clip;
media_sequence_t* sequence = context->sequence;
media_track_t* cur_track;
size_t senc_atom_size;
uint32_t flags;
// saiz / saio
p = mp4_encrypt_passthrough_write_saiz_saio(ctx, p, mdat_atom_start - context->auxiliary_info_size);
// senc
senc_atom_size = ATOM_HEADER_SIZE + sizeof(senc_atom_t) + context->auxiliary_info_size;
write_atom_header(p, senc_atom_size, 's', 'e', 'n', 'c');
flags = context->use_subsamples ? 0x2 : 0x0;
write_be32(p, flags); // flags
write_be32(p, sequence->total_frame_count);
for (cur_clip = sequence->filtered_clips; cur_clip < sequence->filtered_clips_end; cur_clip++)
{
cur_track = cur_clip->first_track;
p = vod_copy(p,
cur_track->encryption_info.auxiliary_info,
cur_track->encryption_info.auxiliary_info_end - cur_track->encryption_info.auxiliary_info);
}
return p;
}
示例3: mp4_builder_write_audio_trun_atom
static u_char*
mp4_builder_write_audio_trun_atom(u_char* p, media_sequence_t* sequence, uint32_t first_frame_offset)
{
media_clip_filtered_t* cur_clip;
input_frame_t* cur_frame;
input_frame_t* last_frame;
size_t atom_size;
atom_size = ATOM_HEADER_SIZE + sizeof(trun_atom_t) + sequence->total_frame_count * 2 * sizeof(uint32_t);
write_atom_header(p, atom_size, 't', 'r', 'u', 'n');
write_be32(p, 0x301); // flags = data offset, duration, size
write_be32(p, sequence->total_frame_count);
write_be32(p, first_frame_offset); // first frame offset relative to moof start offset
for (cur_clip = sequence->filtered_clips; cur_clip < sequence->filtered_clips_end; cur_clip++)
{
cur_frame = cur_clip->first_track->first_frame;
last_frame = cur_clip->first_track->last_frame;
for (; cur_frame < last_frame; cur_frame++)
{
write_be32(p, cur_frame->duration);
write_be32(p, cur_frame->size);
}
}
return p;
}
示例4: hds_write_afra_atom_header
static u_char*
hds_write_afra_atom_header(u_char* p, size_t atom_size, uint32_t video_key_frame_count)
{
write_atom_header(p, atom_size, 'a', 'f', 'r', 'a');
write_be32(p, 0);
*p++ = 0xC0; // LongIDs | LongOffsets
write_be32(p, HDS_TIMESCALE); // timescale
write_be32(p, video_key_frame_count); // entries
return p;
}
示例5: mp4_builder_write_mfhd_atom
u_char*
mp4_builder_write_mfhd_atom(u_char* p, uint32_t segment_index)
{
size_t atom_size = ATOM_HEADER_SIZE + sizeof(mfhd_atom_t);
write_atom_header(p, atom_size, 'm', 'f', 'h', 'd');
write_be32(p, 0);
write_be32(p, segment_index);
return p;
}
示例6: dash_packager_write_tfdt64_atom
static u_char*
dash_packager_write_tfdt64_atom(u_char* p, uint64_t earliest_pres_time)
{
size_t atom_size = ATOM_HEADER_SIZE + sizeof(tfdt64_atom_t);
write_atom_header(p, atom_size, 't', 'f', 'd', 't');
write_dword(p, 0x01000000); // version = 1
write_qword(p, earliest_pres_time);
return p;
}
示例7: mss_playready_audio_write_uuid_piff_atom
static u_char*
mss_playready_audio_write_uuid_piff_atom(u_char* p, mp4_encrypt_state_t* state, media_sequence_t* sequence, size_t atom_size)
{
write_atom_header(p, atom_size, 'u', 'u', 'i', 'd');
p = vod_copy(p, piff_uuid, sizeof(piff_uuid));
write_dword(p, 0);
write_dword(p, sequence->total_frame_count);
p = mp4_encrypt_audio_write_auxiliary_data(state, p);
return p;
}
示例8: mss_write_tfhd_atom
static u_char*
mss_write_tfhd_atom(u_char* p, uint32_t track_id, uint32_t flags)
{
size_t atom_size = ATOM_HEADER_SIZE + sizeof(tfhd_atom_t);
write_atom_header(p, atom_size, 't', 'f', 'h', 'd');
write_dword(p, 0x20); // default sample flags
write_dword(p, track_id);
write_dword(p, flags);
return p;
}
示例9: mss_playready_video_write_uuid_piff_atom
static u_char*
mss_playready_video_write_uuid_piff_atom(u_char* p, mp4_encrypt_video_state_t* state, media_sequence_t* sequence, size_t atom_size)
{
write_atom_header(p, atom_size, 'u', 'u', 'i', 'd');
p = vod_copy(p, piff_uuid, sizeof(piff_uuid));
write_be32(p, 2);
write_be32(p, sequence->total_frame_count);
p = vod_copy(p, state->auxiliary_data.start, state->auxiliary_data.pos - state->auxiliary_data.start);
return p;
}
示例10: mp4_encrypt_audio_write_saiz_saio
u_char*
mp4_encrypt_audio_write_saiz_saio(mp4_encrypt_state_t* state, u_char* p, size_t auxiliary_data_offset)
{
size_t saiz_atom_size = ATOM_HEADER_SIZE + sizeof(saiz_atom_t);
size_t saio_atom_size = ATOM_HEADER_SIZE + sizeof(saio_atom_t);
// moof.traf.saiz
write_atom_header(p, saiz_atom_size, 's', 'a', 'i', 'z');
write_be32(p, 0); // version, flags
*p++ = MP4_AES_CTR_IV_SIZE; // default auxiliary sample size
write_be32(p, state->sequence->total_frame_count);
// moof.traf.saio
write_atom_header(p, saio_atom_size, 's', 'a', 'i', 'o');
write_be32(p, 0); // version, flags
write_be32(p, 1); // entry count
write_be32(p, auxiliary_data_offset);
return p;
}
示例11: mss_write_uuid_tfxd_atom
static u_char*
mss_write_uuid_tfxd_atom(u_char* p, segment_timing_info_t* timing_info)
{
size_t atom_size = ATOM_HEADER_SIZE + sizeof(uuid_tfxd_atom_t);
write_atom_header(p, atom_size, 'u', 'u', 'i', 'd');
p = vod_copy(p, tfxd_uuid, sizeof(tfxd_uuid));
write_be32(p, 0x01000000); // version / flags
write_be64(p, timing_info->timestamp);
write_be64(p, timing_info->duration);
return p;
}
示例12: hds_write_tfhd_atom
static u_char*
hds_write_tfhd_atom(u_char* p, uint32_t track_id, uint64_t base_data_offset)
{
size_t atom_size = ATOM_HEADER_SIZE + sizeof(tfhd_atom_t);
write_atom_header(p, atom_size, 't', 'f', 'h', 'd');
write_be32(p, 3); // flags - base data offset | sample description
write_be32(p, track_id);
write_be64(p, base_data_offset);
write_be32(p, 1); // sample_desc_index
return p;
}
示例13: mp4_encrypt_video_write_saiz_saio
u_char*
mp4_encrypt_video_write_saiz_saio(mp4_encrypt_video_state_t* state, u_char* p, size_t auxiliary_data_offset)
{
// moof.traf.saiz
write_atom_header(p, state->base.saiz_atom_size, 's', 'a', 'i', 'z');
write_be32(p, 0); // version, flags
*p++ = state->default_auxiliary_sample_size;
write_be32(p, state->saiz_sample_count);
if (state->default_auxiliary_sample_size == 0)
{
p = vod_copy(p, state->auxiliary_sample_sizes, state->saiz_sample_count);
}
// moof.traf.saio
write_atom_header(p, state->base.saio_atom_size, 's', 'a', 'i', 'o');
write_be32(p, 0); // version, flags
write_be32(p, 1); // entry count
write_be32(p, auxiliary_data_offset);
return p;
}
示例14: edash_packager_write_pssh
static u_char*
edash_packager_write_pssh(u_char* p, drm_system_info_t* cur_info)
{
size_t pssh_atom_size;
pssh_atom_size = ATOM_HEADER_SIZE + sizeof(pssh_atom_t) + cur_info->data.len;
write_atom_header(p, pssh_atom_size, 'p', 's', 's', 'h');
write_be32(p, 0); // version + flags
p = vod_copy(p, cur_info->system_id, DRM_SYSTEM_ID_SIZE); // system id
write_be32(p, cur_info->data.len); // data size
p = vod_copy(p, cur_info->data.data, cur_info->data.len);
return p;
}
示例15: mss_write_uuid_tfxd_atom
static u_char*
mss_write_uuid_tfxd_atom(u_char* p, mpeg_stream_metadata_t* stream_metadata)
{
size_t atom_size = ATOM_HEADER_SIZE + sizeof(uuid_tfxd_atom_t);
uint64_t timestamp = rescale_time(stream_metadata->first_frame_time_offset, stream_metadata->media_info.timescale, MSS_TIMESCALE);
uint64_t duration = rescale_time(stream_metadata->total_frames_duration, stream_metadata->media_info.timescale, MSS_TIMESCALE);
write_atom_header(p, atom_size, 'u', 'u', 'i', 'd');
p = vod_copy(p, tfxd_uuid, sizeof(tfxd_uuid));
write_dword(p, 0x01000000); // version / flags
write_qword(p, timestamp);
write_qword(p, duration);
return p;
}