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 {
17 inline bool operator==(
const SubsampleEntry& lhs,
const SubsampleEntry& rhs) {
18 return lhs.clear_bytes == rhs.clear_bytes &&
19 lhs.cipher_bytes == rhs.cipher_bytes;
24 inline bool operator==(
const FileType& lhs,
const FileType& rhs) {
25 return lhs.major_brand == rhs.major_brand &&
26 lhs.minor_version == rhs.minor_version &&
27 lhs.compatible_brands == rhs.compatible_brands;
30 inline bool operator==(
const ProtectionSystemSpecificHeader& lhs,
31 const ProtectionSystemSpecificHeader& rhs) {
32 return lhs.raw_box == rhs.raw_box;
35 inline bool operator==(
const SampleAuxiliaryInformationOffset& lhs,
36 const SampleAuxiliaryInformationOffset& rhs) {
37 return lhs.offsets == rhs.offsets;
40 inline bool operator==(
const SampleAuxiliaryInformationSize& lhs,
41 const SampleAuxiliaryInformationSize& rhs) {
42 return lhs.default_sample_info_size == rhs.default_sample_info_size &&
43 lhs.sample_count == rhs.sample_count &&
44 lhs.sample_info_sizes == rhs.sample_info_sizes;
47 inline bool operator==(
const SampleEncryptionEntry& lhs,
48 const SampleEncryptionEntry& rhs) {
49 return lhs.initialization_vector == rhs.initialization_vector &&
50 lhs.subsamples == rhs.subsamples;
53 inline bool operator==(
const SampleEncryption& lhs,
54 const SampleEncryption& rhs) {
55 return lhs.iv_size == rhs.iv_size &&
56 lhs.sample_encryption_entries == rhs.sample_encryption_entries;
59 inline bool operator==(
const OriginalFormat& lhs,
const OriginalFormat& rhs) {
60 return lhs.format == rhs.format;
63 inline bool operator==(
const SchemeType& lhs,
const SchemeType& rhs) {
64 return lhs.type == rhs.type && lhs.version == rhs.version;
67 inline bool operator==(
const TrackEncryption& lhs,
const TrackEncryption& rhs) {
68 return lhs.default_is_protected == rhs.default_is_protected &&
69 lhs.default_per_sample_iv_size == rhs.default_per_sample_iv_size &&
70 lhs.default_kid == rhs.default_kid &&
71 lhs.default_crypt_byte_block == rhs.default_crypt_byte_block &&
72 lhs.default_skip_byte_block == rhs.default_skip_byte_block &&
73 lhs.default_constant_iv == rhs.default_constant_iv;
76 inline bool operator==(
const SchemeInfo& lhs,
const SchemeInfo& rhs) {
77 return lhs.track_encryption == rhs.track_encryption;
80 inline bool operator==(
const ProtectionSchemeInfo& lhs,
81 const ProtectionSchemeInfo& rhs) {
82 return lhs.format == rhs.format && lhs.type == rhs.type &&
86 inline bool operator==(
const MovieHeader& lhs,
const MovieHeader& rhs) {
87 return lhs.creation_time == rhs.creation_time &&
88 lhs.modification_time == rhs.modification_time &&
89 lhs.timescale == rhs.timescale && lhs.duration == rhs.duration &&
90 lhs.rate == rhs.rate && lhs.volume == rhs.volume &&
91 lhs.next_track_id == rhs.next_track_id;
94 inline bool operator==(
const TrackHeader& lhs,
const TrackHeader& rhs) {
95 return lhs.creation_time == rhs.creation_time &&
96 lhs.modification_time == rhs.modification_time &&
97 lhs.track_id == rhs.track_id && lhs.duration == rhs.duration &&
98 lhs.layer == rhs.layer && lhs.alternate_group == rhs.alternate_group &&
99 lhs.volume == rhs.volume && lhs.width == rhs.width &&
100 lhs.height == rhs.height;
103 inline bool operator==(
const SampleDescription& lhs,
104 const SampleDescription& rhs) {
105 return lhs.type == rhs.type && lhs.video_entries == rhs.video_entries &&
106 lhs.audio_entries == rhs.audio_entries;
109 inline bool operator==(
const DecodingTime& lhs,
const DecodingTime& rhs) {
110 return lhs.sample_count == rhs.sample_count &&
111 lhs.sample_delta == rhs.sample_delta;
114 inline bool operator==(
const DecodingTimeToSample& lhs,
115 const DecodingTimeToSample& rhs) {
116 return lhs.decoding_time == rhs.decoding_time;
119 inline bool operator==(
const CompositionOffset& lhs,
120 const CompositionOffset& rhs) {
121 return lhs.sample_count == rhs.sample_count &&
122 lhs.sample_offset == rhs.sample_offset;
125 inline bool operator==(
const CompositionTimeToSample& lhs,
126 const CompositionTimeToSample& rhs) {
127 return lhs.composition_offset == rhs.composition_offset;
130 inline bool operator==(
const ChunkInfo& lhs,
const ChunkInfo& rhs) {
131 return lhs.first_chunk == rhs.first_chunk &&
132 lhs.samples_per_chunk == rhs.samples_per_chunk &&
133 lhs.sample_description_index == rhs.sample_description_index;
136 inline bool operator==(
const SampleToChunk& lhs,
const SampleToChunk& rhs) {
137 return lhs.chunk_info == rhs.chunk_info;
140 inline bool operator==(
const SampleSize& lhs,
const SampleSize& rhs) {
141 return lhs.sample_size == rhs.sample_size &&
142 lhs.sample_count == rhs.sample_count && lhs.sizes == rhs.sizes;
145 inline bool operator==(
const CompactSampleSize& lhs,
146 const CompactSampleSize& rhs) {
147 return lhs.field_size == rhs.field_size && lhs.sizes == rhs.sizes;
150 inline bool operator==(
const ChunkLargeOffset& lhs,
151 const ChunkLargeOffset& rhs) {
152 return lhs.offsets == rhs.offsets;
155 inline bool operator==(
const SyncSample& lhs,
const SyncSample& rhs) {
156 return lhs.sample_number == rhs.sample_number;
159 inline bool operator==(
const SampleTable& lhs,
const SampleTable& rhs) {
160 return lhs.description == rhs.description &&
161 lhs.decoding_time_to_sample == rhs.decoding_time_to_sample &&
162 lhs.composition_time_to_sample == rhs.composition_time_to_sample &&
163 lhs.sample_to_chunk == rhs.sample_to_chunk &&
164 lhs.sample_size == rhs.sample_size &&
165 lhs.chunk_large_offset == rhs.chunk_large_offset &&
166 lhs.sync_sample == rhs.sync_sample;
169 inline bool operator==(
const EditListEntry& lhs,
const EditListEntry& rhs) {
170 return lhs.segment_duration == rhs.segment_duration &&
171 lhs.media_time == rhs.media_time &&
172 lhs.media_rate_integer == rhs.media_rate_integer &&
173 lhs.media_rate_fraction == rhs.media_rate_fraction;
176 inline bool operator==(
const EditList& lhs,
const EditList& rhs) {
177 return lhs.edits == rhs.edits;
180 inline bool operator==(
const Edit& lhs,
const Edit& rhs) {
181 return lhs.list == rhs.list;
184 inline bool operator==(
const HandlerReference& lhs,
185 const HandlerReference& rhs) {
186 return lhs.handler_type == rhs.handler_type;
189 inline bool operator==(
const Language& lhs,
190 const Language& rhs) {
191 return lhs.code == rhs.code;
194 inline bool operator==(
const PrivFrame& lhs,
const PrivFrame& rhs) {
195 return lhs.owner == rhs.owner && lhs.value == rhs.value;
198 inline bool operator==(
const ID3v2& lhs,
const ID3v2& rhs) {
199 return lhs.language == rhs.language && lhs.private_frame == rhs.private_frame;
202 inline bool operator==(
const Metadata& lhs,
const Metadata& rhs) {
203 return lhs.handler == rhs.handler && lhs.id3v2 == rhs.id3v2;
206 inline bool operator==(
const CodecConfigurationRecord& lhs,
207 const CodecConfigurationRecord& rhs) {
208 return lhs.data == rhs.data;
211 inline bool operator==(
const PixelAspectRatio& lhs,
212 const PixelAspectRatio& rhs) {
213 return lhs.h_spacing == rhs.h_spacing && lhs.v_spacing == rhs.v_spacing;
216 inline bool operator==(
const VideoSampleEntry& lhs,
217 const VideoSampleEntry& rhs) {
218 return lhs.format == rhs.format &&
219 lhs.data_reference_index == rhs.data_reference_index &&
220 lhs.width == rhs.width && lhs.height == rhs.height &&
221 lhs.pixel_aspect == rhs.pixel_aspect && lhs.sinf == rhs.sinf &&
222 lhs.codec_config_record == rhs.codec_config_record;
225 inline bool operator==(
const ESDescriptor& lhs,
const ESDescriptor& rhs) {
226 return lhs.esid() == rhs.esid() && lhs.object_type() == rhs.object_type() &&
227 lhs.max_bitrate() == rhs.max_bitrate() &&
228 lhs.avg_bitrate() == rhs.avg_bitrate() &&
229 lhs.decoder_specific_info() == rhs.decoder_specific_info();
232 inline bool operator==(
const ElementaryStreamDescriptor& lhs,
233 const ElementaryStreamDescriptor& rhs) {
234 return lhs.es_descriptor == rhs.es_descriptor;
237 inline bool operator==(
const DTSSpecific& lhs,
238 const DTSSpecific& rhs) {
239 return lhs.sampling_frequency == rhs.sampling_frequency &&
240 lhs.max_bitrate == rhs.max_bitrate &&
241 lhs.avg_bitrate == rhs.avg_bitrate &&
242 lhs.pcm_sample_depth == rhs.pcm_sample_depth &&
243 lhs.extra_data == rhs.extra_data;
246 inline bool operator==(
const AC3Specific& lhs,
247 const AC3Specific& rhs) {
248 return lhs.data == rhs.data;
251 inline bool operator==(
const EC3Specific& lhs,
252 const EC3Specific& rhs) {
253 return lhs.data == rhs.data;
256 inline bool operator==(
const AudioSampleEntry& lhs,
257 const AudioSampleEntry& rhs) {
258 return lhs.format == rhs.format &&
259 lhs.data_reference_index == rhs.data_reference_index &&
260 lhs.channelcount == rhs.channelcount &&
261 lhs.samplesize == rhs.samplesize && lhs.samplerate == rhs.samplerate &&
262 lhs.sinf == rhs.sinf && lhs.esds == rhs.esds && lhs.ddts == rhs.ddts &&
263 lhs.dac3 == rhs.dac3 && lhs.dec3 == rhs.dec3;
266 inline bool operator==(
const WebVTTConfigurationBox& lhs,
267 const WebVTTConfigurationBox& rhs) {
268 return lhs.config == rhs.config;
271 inline bool operator==(
const WebVTTSourceLabelBox& lhs,
272 const WebVTTSourceLabelBox& rhs) {
273 return lhs.source_label == rhs.source_label;
276 inline bool operator==(
const TextSampleEntry& lhs,
const TextSampleEntry& rhs) {
277 return lhs.config == rhs.config && lhs.label == rhs.label;
280 inline bool operator==(
const MediaHeader& lhs,
const MediaHeader& rhs) {
281 return lhs.creation_time == rhs.creation_time &&
282 lhs.modification_time == rhs.modification_time &&
283 lhs.timescale == rhs.timescale && lhs.duration == rhs.duration &&
284 lhs.language == rhs.language;
287 inline bool operator==(
const VideoMediaHeader& lhs,
288 const VideoMediaHeader& rhs) {
289 return lhs.graphicsmode == rhs.graphicsmode &&
290 lhs.opcolor_red == rhs.opcolor_red &&
291 lhs.opcolor_green == rhs.opcolor_green &&
292 lhs.opcolor_blue == rhs.opcolor_blue;
295 inline bool operator==(
const SoundMediaHeader& lhs,
296 const SoundMediaHeader& rhs) {
297 return lhs.balance == rhs.balance;
300 inline bool operator==(
const SubtitleMediaHeader& lhs,
301 const SubtitleMediaHeader& rhs) {
305 inline bool operator==(
const DataEntryUrl& lhs,
const DataEntryUrl& rhs) {
306 return lhs.flags == rhs.flags && lhs.location == rhs.location;
309 inline bool operator==(
const DataReference& lhs,
const DataReference& rhs) {
310 return lhs.data_entry == rhs.data_entry;
313 inline bool operator==(
const DataInformation& lhs,
const DataInformation& rhs) {
314 return lhs.dref == rhs.dref;
317 inline bool operator==(
const MediaInformation& lhs,
318 const MediaInformation& rhs) {
319 return lhs.dinf == rhs.dinf && lhs.sample_table == rhs.sample_table &&
320 lhs.vmhd == rhs.vmhd && lhs.smhd == rhs.smhd;
323 inline bool operator==(
const Media& lhs,
const Media& rhs) {
324 return lhs.header == rhs.header && lhs.handler == rhs.handler &&
325 lhs.information == rhs.information;
328 inline bool operator==(
const Track& lhs,
const Track& rhs) {
329 return lhs.header == rhs.header && lhs.media == rhs.media &&
330 lhs.edit == rhs.edit && lhs.sample_encryption == rhs.sample_encryption;
333 inline bool operator==(
const MovieExtendsHeader& lhs,
334 const MovieExtendsHeader& rhs) {
335 return lhs.fragment_duration == rhs.fragment_duration;
338 inline bool operator==(
const TrackExtends& lhs,
const TrackExtends& rhs) {
339 return lhs.track_id == rhs.track_id &&
340 lhs.default_sample_description_index ==
341 rhs.default_sample_description_index &&
342 lhs.default_sample_duration == rhs.default_sample_duration &&
343 lhs.default_sample_size == rhs.default_sample_size &&
344 lhs.default_sample_flags == rhs.default_sample_flags;
347 inline bool operator==(
const MovieExtends& lhs,
const MovieExtends& rhs) {
348 return lhs.header == rhs.header && lhs.tracks == rhs.tracks;
351 inline bool operator==(
const Movie& lhs,
const Movie& rhs) {
352 return lhs.header == rhs.header && lhs.extends == rhs.extends &&
353 lhs.tracks == rhs.tracks && lhs.pssh == rhs.pssh;
356 inline bool operator==(
const TrackFragmentDecodeTime& lhs,
357 const TrackFragmentDecodeTime& rhs) {
358 return lhs.decode_time == rhs.decode_time;
361 inline bool operator==(
const MovieFragmentHeader& lhs,
362 const MovieFragmentHeader& rhs) {
363 return lhs.sequence_number == rhs.sequence_number;
366 inline bool operator==(
const TrackFragmentHeader& lhs,
367 const TrackFragmentHeader& rhs) {
368 return lhs.flags == rhs.flags && lhs.track_id == rhs.track_id &&
369 lhs.sample_description_index == rhs.sample_description_index &&
370 lhs.default_sample_duration == rhs.default_sample_duration &&
371 lhs.default_sample_size == rhs.default_sample_size &&
372 lhs.default_sample_flags == rhs.default_sample_flags;
375 inline bool operator==(
const TrackFragmentRun& lhs,
376 const TrackFragmentRun& rhs) {
377 return lhs.flags == rhs.flags && lhs.sample_count == rhs.sample_count &&
378 lhs.data_offset == rhs.data_offset &&
379 lhs.sample_flags == rhs.sample_flags &&
380 lhs.sample_sizes == rhs.sample_sizes &&
381 lhs.sample_durations == rhs.sample_durations &&
382 lhs.sample_composition_time_offsets ==
383 rhs.sample_composition_time_offsets;
386 inline bool operator==(
const SampleToGroupEntry& lhs,
387 const SampleToGroupEntry& rhs) {
388 return lhs.sample_count == rhs.sample_count &&
389 lhs.group_description_index == rhs.group_description_index;
392 inline bool operator==(
const SampleToGroup& lhs,
393 const SampleToGroup& rhs) {
394 return lhs.grouping_type == rhs.grouping_type &&
395 lhs.grouping_type_parameter == rhs.grouping_type_parameter &&
396 lhs.entries == rhs.entries;
399 inline bool operator==(
const CencSampleEncryptionInfoEntry& lhs,
400 const CencSampleEncryptionInfoEntry& rhs) {
401 return lhs.is_protected == rhs.is_protected &&
402 lhs.per_sample_iv_size == rhs.per_sample_iv_size &&
403 lhs.key_id == rhs.key_id &&
404 lhs.crypt_byte_block == rhs.crypt_byte_block &&
405 lhs.skip_byte_block == rhs.skip_byte_block &&
406 lhs.constant_iv == rhs.constant_iv;
409 inline bool operator==(
const SampleGroupDescription& lhs,
410 const SampleGroupDescription& rhs) {
411 return lhs.grouping_type == rhs.grouping_type &&
412 lhs.entries == rhs.entries;
415 inline bool operator==(
const TrackFragment& lhs,
const TrackFragment& rhs) {
416 return lhs.header == rhs.header && lhs.runs == rhs.runs &&
417 lhs.decode_time == rhs.decode_time &&
418 lhs.auxiliary_offset == rhs.auxiliary_offset &&
419 lhs.auxiliary_size == rhs.auxiliary_size &&
420 lhs.sample_encryption == rhs.sample_encryption;
423 inline bool operator==(
const MovieFragment& lhs,
const MovieFragment& rhs) {
424 return lhs.header == rhs.header && lhs.tracks == rhs.tracks &&
425 lhs.pssh == rhs.pssh;
428 inline bool operator==(
const SegmentReference& lhs,
429 const SegmentReference& rhs) {
430 return lhs.reference_type == rhs.reference_type &&
431 lhs.referenced_size == rhs.referenced_size &&
432 lhs.subsegment_duration == rhs.subsegment_duration &&
433 lhs.starts_with_sap == rhs.starts_with_sap &&
434 lhs.sap_type == rhs.sap_type &&
435 lhs.sap_delta_time == rhs.sap_delta_time;
438 inline bool operator==(
const SegmentIndex& lhs,
const SegmentIndex& rhs) {
439 return lhs.reference_id == rhs.reference_id &&
440 lhs.timescale == rhs.timescale &&
441 lhs.earliest_presentation_time == rhs.earliest_presentation_time &&
442 lhs.first_offset == rhs.first_offset &&
443 lhs.references == rhs.references;
446 inline bool operator==(
const CueSourceIDBox& lhs,
447 const CueSourceIDBox& rhs) {
448 return lhs.source_id == rhs.source_id;
451 inline bool operator==(
const CueTimeBox& lhs,
452 const CueTimeBox& rhs) {
453 return lhs.cue_current_time == rhs.cue_current_time;
456 inline bool operator==(
const CueIDBox& lhs,
457 const CueIDBox& rhs) {
458 return lhs.cue_id == rhs.cue_id;
461 inline bool operator==(
const CueSettingsBox& lhs,
462 const CueSettingsBox& rhs) {
463 return lhs.settings == rhs.settings;
466 inline bool operator==(
const CuePayloadBox& lhs,
467 const CuePayloadBox& rhs) {
468 return lhs.cue_text == rhs.cue_text;
471 inline bool operator==(
const VTTEmptyCueBox& lhs,
const VTTEmptyCueBox& rhs) {
475 inline bool operator==(
const VTTAdditionalTextBox& lhs,
476 const VTTAdditionalTextBox& rhs) {
477 return lhs.cue_additional_text == rhs.cue_additional_text;
480 inline bool operator==(
const VTTCueBox& lhs,
481 const VTTCueBox& rhs) {
482 return lhs.cue_source_id == rhs.cue_source_id && lhs.cue_id == rhs.cue_id &&
483 lhs.cue_time == rhs.cue_time && lhs.cue_settings == rhs.cue_settings &&
484 lhs.cue_payload == rhs.cue_payload;
491 #endif // MEDIA_FORMATS_MP4_BOX_DEFINITIONS_COMPARISON_H_