9 #ifndef MEDIA_FORMATS_MP4_BOX_DEFINITIONS_COMPARISON_H_
10 #define MEDIA_FORMATS_MP4_BOX_DEFINITIONS_COMPARISON_H_
12 #include "packager/media/formats/mp4/box_definitions.h"
14 namespace edash_packager {
18 inline bool operator==(
const FileType& lhs,
const FileType& rhs) {
19 return lhs.major_brand == rhs.major_brand &&
20 lhs.minor_version == rhs.minor_version &&
21 lhs.compatible_brands == rhs.compatible_brands;
24 inline bool operator==(
const ProtectionSystemSpecificHeader& lhs,
25 const ProtectionSystemSpecificHeader& rhs) {
26 return lhs.system_id == rhs.system_id && lhs.data == rhs.data;
29 inline bool operator==(
const SampleAuxiliaryInformationOffset& lhs,
30 const SampleAuxiliaryInformationOffset& rhs) {
31 return lhs.offsets == rhs.offsets;
34 inline bool operator==(
const SampleAuxiliaryInformationSize& lhs,
35 const SampleAuxiliaryInformationSize& rhs) {
36 return lhs.default_sample_info_size == rhs.default_sample_info_size &&
37 lhs.sample_count == rhs.sample_count &&
38 lhs.sample_info_sizes == rhs.sample_info_sizes;
41 inline bool operator==(
const OriginalFormat& lhs,
const OriginalFormat& rhs) {
42 return lhs.format == rhs.format;
45 inline bool operator==(
const SchemeType& lhs,
const SchemeType& rhs) {
46 return lhs.type == rhs.type && lhs.version == rhs.version;
49 inline bool operator==(
const TrackEncryption& lhs,
const TrackEncryption& rhs) {
50 return lhs.is_encrypted == rhs.is_encrypted &&
51 lhs.default_iv_size == rhs.default_iv_size &&
52 lhs.default_kid == rhs.default_kid;
55 inline bool operator==(
const SchemeInfo& lhs,
const SchemeInfo& rhs) {
56 return lhs.track_encryption == rhs.track_encryption;
59 inline bool operator==(
const ProtectionSchemeInfo& lhs,
60 const ProtectionSchemeInfo& rhs) {
61 return lhs.format == rhs.format && lhs.type == rhs.type &&
65 inline bool operator==(
const MovieHeader& lhs,
const MovieHeader& rhs) {
66 return lhs.creation_time == rhs.creation_time &&
67 lhs.modification_time == rhs.modification_time &&
68 lhs.timescale == rhs.timescale && lhs.duration == rhs.duration &&
69 lhs.rate == rhs.rate && lhs.volume == rhs.volume &&
70 lhs.next_track_id == rhs.next_track_id;
73 inline bool operator==(
const TrackHeader& lhs,
const TrackHeader& rhs) {
74 return lhs.creation_time == rhs.creation_time &&
75 lhs.modification_time == rhs.modification_time &&
76 lhs.track_id == rhs.track_id && lhs.duration == rhs.duration &&
77 lhs.layer == rhs.layer && lhs.alternate_group == rhs.alternate_group &&
78 lhs.volume == rhs.volume && lhs.width == rhs.width &&
79 lhs.height == rhs.height;
82 inline bool operator==(
const SampleDescription& lhs,
83 const SampleDescription& rhs) {
84 return lhs.type == rhs.type && lhs.video_entries == rhs.video_entries &&
85 lhs.audio_entries == rhs.audio_entries;
88 inline bool operator==(
const DecodingTime& lhs,
const DecodingTime& rhs) {
89 return lhs.sample_count == rhs.sample_count &&
90 lhs.sample_delta == rhs.sample_delta;
93 inline bool operator==(
const DecodingTimeToSample& lhs,
94 const DecodingTimeToSample& rhs) {
95 return lhs.decoding_time == rhs.decoding_time;
98 inline bool operator==(
const CompositionOffset& lhs,
99 const CompositionOffset& rhs) {
100 return lhs.sample_count == rhs.sample_count &&
101 lhs.sample_offset == rhs.sample_offset;
104 inline bool operator==(
const CompositionTimeToSample& lhs,
105 const CompositionTimeToSample& rhs) {
106 return lhs.composition_offset == rhs.composition_offset;
109 inline bool operator==(
const ChunkInfo& lhs,
const ChunkInfo& rhs) {
110 return lhs.first_chunk == rhs.first_chunk &&
111 lhs.samples_per_chunk == rhs.samples_per_chunk &&
112 lhs.sample_description_index == rhs.sample_description_index;
115 inline bool operator==(
const SampleToChunk& lhs,
const SampleToChunk& rhs) {
116 return lhs.chunk_info == rhs.chunk_info;
119 inline bool operator==(
const SampleSize& lhs,
const SampleSize& rhs) {
120 return lhs.sample_size == rhs.sample_size &&
121 lhs.sample_count == rhs.sample_count && lhs.sizes == rhs.sizes;
124 inline bool operator==(
const CompactSampleSize& lhs,
125 const CompactSampleSize& rhs) {
126 return lhs.field_size == rhs.field_size && lhs.sizes == rhs.sizes;
129 inline bool operator==(
const ChunkLargeOffset& lhs,
130 const ChunkLargeOffset& rhs) {
131 return lhs.offsets == rhs.offsets;
134 inline bool operator==(
const SyncSample& lhs,
const SyncSample& rhs) {
135 return lhs.sample_number == rhs.sample_number;
138 inline bool operator==(
const SampleTable& lhs,
const SampleTable& rhs) {
139 return lhs.description == rhs.description &&
140 lhs.decoding_time_to_sample == rhs.decoding_time_to_sample &&
141 lhs.composition_time_to_sample == rhs.composition_time_to_sample &&
142 lhs.sample_to_chunk == rhs.sample_to_chunk &&
143 lhs.sample_size == rhs.sample_size &&
144 lhs.chunk_large_offset == rhs.chunk_large_offset &&
145 lhs.sync_sample == rhs.sync_sample;
148 inline bool operator==(
const EditListEntry& lhs,
const EditListEntry& rhs) {
149 return lhs.segment_duration == rhs.segment_duration &&
150 lhs.media_time == rhs.media_time &&
151 lhs.media_rate_integer == rhs.media_rate_integer &&
152 lhs.media_rate_fraction == rhs.media_rate_fraction;
155 inline bool operator==(
const EditList& lhs,
const EditList& rhs) {
156 return lhs.edits == rhs.edits;
159 inline bool operator==(
const Edit& lhs,
const Edit& rhs) {
160 return lhs.list == rhs.list;
163 inline bool operator==(
const HandlerReference& lhs,
164 const HandlerReference& rhs) {
165 return lhs.type == rhs.type;
168 inline bool operator==(
const CodecConfigurationRecord& lhs,
169 const CodecConfigurationRecord& rhs) {
170 return lhs.data == rhs.data;
173 inline bool operator==(
const PixelAspectRatioBox& lhs,
174 const PixelAspectRatioBox& rhs) {
175 return lhs.h_spacing == rhs.h_spacing && lhs.v_spacing == rhs.v_spacing;
178 inline bool operator==(
const VideoSampleEntry& lhs,
179 const VideoSampleEntry& rhs) {
180 return lhs.format == rhs.format &&
181 lhs.data_reference_index == rhs.data_reference_index &&
182 lhs.width == rhs.width && lhs.height == rhs.height &&
183 lhs.pixel_aspect == rhs.pixel_aspect && lhs.sinf == rhs.sinf &&
184 lhs.codec_config_record == rhs.codec_config_record;
187 inline bool operator==(
const ESDescriptor& lhs,
const ESDescriptor& rhs) {
188 return lhs.esid() == rhs.esid() && lhs.object_type() == rhs.object_type() &&
189 lhs.decoder_specific_info() == rhs.decoder_specific_info();
192 inline bool operator==(
const ElementaryStreamDescriptor& lhs,
193 const ElementaryStreamDescriptor& rhs) {
194 return lhs.es_descriptor == rhs.es_descriptor;
197 inline bool operator==(
const AudioSampleEntry& lhs,
198 const AudioSampleEntry& rhs) {
199 return lhs.format == rhs.format &&
200 lhs.data_reference_index == rhs.data_reference_index &&
201 lhs.channelcount == rhs.channelcount &&
202 lhs.samplesize == rhs.samplesize && lhs.samplerate == rhs.samplerate &&
203 lhs.sinf == rhs.sinf && lhs.esds == rhs.esds;
206 inline bool operator==(
const MediaHeader& lhs,
const MediaHeader& rhs) {
207 return lhs.creation_time == rhs.creation_time &&
208 lhs.modification_time == rhs.modification_time &&
209 lhs.timescale == rhs.timescale && lhs.duration == rhs.duration &&
210 strcmp(lhs.language, rhs.language) == 0;
213 inline bool operator==(
const VideoMediaHeader& lhs,
214 const VideoMediaHeader& rhs) {
215 return lhs.graphicsmode == rhs.graphicsmode &&
216 lhs.opcolor_red == rhs.opcolor_red &&
217 lhs.opcolor_green == rhs.opcolor_green &&
218 lhs.opcolor_blue == rhs.opcolor_blue;
221 inline bool operator==(
const SoundMediaHeader& lhs,
222 const SoundMediaHeader& rhs) {
223 return lhs.balance == rhs.balance;
226 inline bool operator==(
const DataEntryUrl& lhs,
const DataEntryUrl& rhs) {
227 return lhs.flags == rhs.flags && lhs.location == rhs.location;
230 inline bool operator==(
const DataReference& lhs,
const DataReference& rhs) {
231 return lhs.data_entry == rhs.data_entry;
234 inline bool operator==(
const DataInformation& lhs,
const DataInformation& rhs) {
235 return lhs.dref == rhs.dref;
238 inline bool operator==(
const MediaInformation& lhs,
239 const MediaInformation& rhs) {
240 return lhs.dinf == rhs.dinf && lhs.sample_table == rhs.sample_table &&
241 lhs.vmhd == rhs.vmhd && lhs.smhd == rhs.smhd;
244 inline bool operator==(
const Media& lhs,
const Media& rhs) {
245 return lhs.header == rhs.header && lhs.handler == rhs.handler &&
246 lhs.information == rhs.information;
249 inline bool operator==(
const Track& lhs,
const Track& rhs) {
250 return lhs.header == rhs.header && lhs.media == rhs.media &&
251 lhs.edit == rhs.edit;
254 inline bool operator==(
const MovieExtendsHeader& lhs,
255 const MovieExtendsHeader& rhs) {
256 return lhs.fragment_duration == rhs.fragment_duration;
259 inline bool operator==(
const TrackExtends& lhs,
const TrackExtends& rhs) {
260 return lhs.track_id == rhs.track_id &&
261 lhs.default_sample_description_index ==
262 rhs.default_sample_description_index &&
263 lhs.default_sample_duration == rhs.default_sample_duration &&
264 lhs.default_sample_size == rhs.default_sample_size &&
265 lhs.default_sample_flags == rhs.default_sample_flags;
268 inline bool operator==(
const MovieExtends& lhs,
const MovieExtends& rhs) {
269 return lhs.header == rhs.header && lhs.tracks == rhs.tracks;
272 inline bool operator==(
const Movie& lhs,
const Movie& rhs) {
273 return lhs.header == rhs.header && lhs.extends == rhs.extends &&
274 lhs.tracks == rhs.tracks && lhs.pssh == rhs.pssh;
277 inline bool operator==(
const TrackFragmentDecodeTime& lhs,
278 const TrackFragmentDecodeTime& rhs) {
279 return lhs.decode_time == rhs.decode_time;
282 inline bool operator==(
const MovieFragmentHeader& lhs,
283 const MovieFragmentHeader& rhs) {
284 return lhs.sequence_number == rhs.sequence_number;
287 inline bool operator==(
const TrackFragmentHeader& lhs,
288 const TrackFragmentHeader& rhs) {
289 return lhs.flags == rhs.flags && lhs.track_id == rhs.track_id &&
290 lhs.sample_description_index == rhs.sample_description_index &&
291 lhs.default_sample_duration == rhs.default_sample_duration &&
292 lhs.default_sample_size == rhs.default_sample_size &&
293 lhs.default_sample_flags == rhs.default_sample_flags;
296 inline bool operator==(
const TrackFragmentRun& lhs,
297 const TrackFragmentRun& rhs) {
298 return lhs.flags == rhs.flags && lhs.sample_count == rhs.sample_count &&
299 lhs.data_offset == rhs.data_offset &&
300 lhs.sample_flags == rhs.sample_flags &&
301 lhs.sample_sizes == rhs.sample_sizes &&
302 lhs.sample_durations == rhs.sample_durations &&
303 lhs.sample_composition_time_offsets ==
304 rhs.sample_composition_time_offsets;
307 inline bool operator==(
const SampleToGroupEntry& lhs,
308 const SampleToGroupEntry& rhs) {
309 return lhs.sample_count == rhs.sample_count &&
310 lhs.group_description_index == rhs.group_description_index;
313 inline bool operator==(
const SampleToGroup& lhs,
314 const SampleToGroup& rhs) {
315 return lhs.grouping_type == rhs.grouping_type &&
316 lhs.grouping_type_parameter == rhs.grouping_type_parameter &&
317 lhs.entries == rhs.entries;
320 inline bool operator==(
const CencSampleEncryptionInfoEntry& lhs,
321 const CencSampleEncryptionInfoEntry& rhs) {
322 return lhs.is_encrypted == rhs.is_encrypted &&
323 lhs.iv_size == rhs.iv_size &&
324 lhs.key_id == rhs.key_id;
327 inline bool operator==(
const SampleGroupDescription& lhs,
328 const SampleGroupDescription& rhs) {
329 return lhs.grouping_type == rhs.grouping_type &&
330 lhs.entries == rhs.entries;
333 inline bool operator==(
const TrackFragment& lhs,
const TrackFragment& rhs) {
334 return lhs.header == rhs.header && lhs.runs == rhs.runs &&
335 lhs.decode_time == rhs.decode_time &&
336 lhs.auxiliary_offset == rhs.auxiliary_offset &&
337 lhs.auxiliary_size == rhs.auxiliary_size;
340 inline bool operator==(
const MovieFragment& lhs,
const MovieFragment& rhs) {
341 return lhs.header == rhs.header && lhs.tracks == rhs.tracks &&
342 lhs.pssh == rhs.pssh;
345 inline bool operator==(
const SegmentReference& lhs,
346 const SegmentReference& rhs) {
347 return lhs.reference_type == rhs.reference_type &&
348 lhs.referenced_size == rhs.referenced_size &&
349 lhs.subsegment_duration == rhs.subsegment_duration &&
350 lhs.starts_with_sap == rhs.starts_with_sap &&
351 lhs.sap_type == rhs.sap_type &&
352 lhs.sap_delta_time == rhs.sap_delta_time;
355 inline bool operator==(
const SegmentIndex& lhs,
const SegmentIndex& rhs) {
356 return lhs.reference_id == rhs.reference_id &&
357 lhs.timescale == rhs.timescale &&
358 lhs.earliest_presentation_time == rhs.earliest_presentation_time &&
359 lhs.first_offset == rhs.first_offset &&
360 lhs.references == rhs.references;
367 #endif // MEDIA_FORMATS_MP4_BOX_DEFINITIONS_COMPARISON_H_