27 #ifndef SRC_PLAYER_ES_DASH_PLAYER_DEMUXER_ELEMENTARY_STREAM_PACKET_H_ 28 #define SRC_PLAYER_ES_DASH_PLAYER_DEMUXER_ELEMENTARY_STREAM_PACKET_H_ 32 #include "nacl_player/media_common.h" 74 const Samsung::NaClPlayer::ESPacket&
GetESPacket()
const;
84 bool IsKeyFrame()
const {
return es_packet_.is_key_frame; }
91 Samsung::NaClPlayer::TimeTicks
GetPts()
const {
return es_packet_.pts; }
95 Samsung::NaClPlayer::TimeTicks
GetDts()
const {
return es_packet_.dts; }
100 return es_packet_.duration;
105 void SetKeyFrame(
bool key_frame) { es_packet_.is_key_frame = key_frame; }
109 void SetPts(Samsung::NaClPlayer::TimeTicks pts) { es_packet_.pts = pts; }
113 void SetDts(Samsung::NaClPlayer::TimeTicks dts) { es_packet_.dts = dts; }
118 es_packet_.duration = duration;
126 void SetKeyId(uint8_t* key_id, uint32_t key_id_size);
133 void SetIv(uint8_t* iv, uint32_t iv_size);
144 void AddSubsample(uint32_t clear_bytes, uint32_t cipher_bytes);
153 void FixDataInvariant();
157 void FixKeyIdInvariant();
161 void FixIvInvariant();
165 void FixSubsamplesInvariant();
167 std::vector<uint8_t> data_;
168 Samsung::NaClPlayer::ESPacket es_packet_;
170 std::vector<uint8_t> key_id_;
171 std::vector<uint8_t> iv_;
172 std::vector<Samsung::NaClPlayer::EncryptedSubsampleDescription> subsamples_;
173 Samsung::NaClPlayer::ESPacketEncryptionInfo encryption_info_;
176 #endif // SRC_PLAYER_ES_DASH_PLAYER_DEMUXER_ELEMENTARY_STREAM_PACKET_H_ const Samsung::NaClPlayer::ESPacket & GetESPacket() const
Returns Elementary Stream Packet.
Samsung::NaClPlayer::TimeTicks GetDts() const
void SetDts(Samsung::NaClPlayer::TimeTicks dts)
void SetIv(uint8_t *iv, uint32_t iv_size)
Samsung::NaClPlayer::TimeTicks GetPts() const
void SetDuration(Samsung::NaClPlayer::TimeTicks duration)
uint32_t GetDataSize() const
Returns size of packet's data.
void SetKeyFrame(bool key_frame)
ElementaryStreamPacket & operator=(const ElementaryStreamPacket &)=delete
ElementaryStreamPacket(uint8_t *data, uint32_t size)
~ElementaryStreamPacket()=default
Destroys ElementaryStreamPacket object.
void AddSubsample(uint32_t clear_bytes, uint32_t cipher_bytes)
void SetKeyId(uint8_t *key_id, uint32_t key_id_size)
This class is a wrapper for both Samsung::NaClPlayer::ESPacket and encryption information.
const Samsung::NaClPlayer::ESPacketEncryptionInfo & GetEncryptionInfo() const
Returns Encryption information.
Samsung::NaClPlayer::TimeTicks GetDuration() const
bool IsEncrypted() const
Returns true if packet is encrypted, otherwise false.
void ClearSubsamples()
Clears the subsample information about encrypted bytes in packet.
void SetPts(Samsung::NaClPlayer::TimeTicks pts)