| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_MPEG1AUDIO_H_ | 5 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_MPEG1AUDIO_H_ |
| 6 #define MEDIA_FORMATS_MP2T_ES_PARSER_MPEG1AUDIO_H_ | 6 #define MEDIA_FORMATS_MP2T_ES_PARSER_MPEG1AUDIO_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class MEDIA_EXPORT EsParserMpeg1Audio : public EsParser { | 30 class MEDIA_EXPORT EsParserMpeg1Audio : public EsParser { |
| 31 public: | 31 public: |
| 32 typedef base::Callback<void(const AudioDecoderConfig&)> NewAudioConfigCB; | 32 typedef base::Callback<void(const AudioDecoderConfig&)> NewAudioConfigCB; |
| 33 | 33 |
| 34 EsParserMpeg1Audio(const NewAudioConfigCB& new_audio_config_cb, | 34 EsParserMpeg1Audio(const NewAudioConfigCB& new_audio_config_cb, |
| 35 const EmitBufferCB& emit_buffer_cb, | 35 const EmitBufferCB& emit_buffer_cb, |
| 36 const LogCB& log_cb); | 36 const LogCB& log_cb); |
| 37 virtual ~EsParserMpeg1Audio(); | 37 virtual ~EsParserMpeg1Audio(); |
| 38 | 38 |
| 39 // EsParser implementation. | 39 // EsParser implementation. |
| 40 virtual void Flush() OVERRIDE; | 40 virtual void Flush() override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // Used to link a PTS with a byte position in the ES stream. | 43 // Used to link a PTS with a byte position in the ES stream. |
| 44 typedef std::pair<int64, base::TimeDelta> EsPts; | 44 typedef std::pair<int64, base::TimeDelta> EsPts; |
| 45 typedef std::list<EsPts> EsPtsList; | 45 typedef std::list<EsPts> EsPtsList; |
| 46 | 46 |
| 47 struct Mpeg1AudioFrame; | 47 struct Mpeg1AudioFrame; |
| 48 | 48 |
| 49 // EsParser implementation. | 49 // EsParser implementation. |
| 50 virtual bool ParseFromEsQueue() OVERRIDE; | 50 virtual bool ParseFromEsQueue() override; |
| 51 virtual void ResetInternal() OVERRIDE; | 51 virtual void ResetInternal() override; |
| 52 | 52 |
| 53 // Synchronize the stream on a Mpeg1 audio syncword (consuming bytes from | 53 // Synchronize the stream on a Mpeg1 audio syncword (consuming bytes from |
| 54 // |es_queue_| if needed). | 54 // |es_queue_| if needed). |
| 55 // Returns true when a full Mpeg1 audio frame has been found: in that case | 55 // Returns true when a full Mpeg1 audio frame has been found: in that case |
| 56 // |mpeg1audio_frame| structure is filled up accordingly. | 56 // |mpeg1audio_frame| structure is filled up accordingly. |
| 57 // Returns false otherwise (no Mpeg1 audio syncword found or partial Mpeg1 | 57 // Returns false otherwise (no Mpeg1 audio syncword found or partial Mpeg1 |
| 58 // audio frame). | 58 // audio frame). |
| 59 bool LookForMpeg1AudioFrame(Mpeg1AudioFrame* mpeg1audio_frame); | 59 bool LookForMpeg1AudioFrame(Mpeg1AudioFrame* mpeg1audio_frame); |
| 60 | 60 |
| 61 // Signal any audio configuration change (if any). | 61 // Signal any audio configuration change (if any). |
| (...skipping 17 matching lines...) Expand all Loading... |
| 79 // Last audio config. | 79 // Last audio config. |
| 80 AudioDecoderConfig last_audio_decoder_config_; | 80 AudioDecoderConfig last_audio_decoder_config_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(EsParserMpeg1Audio); | 82 DISALLOW_COPY_AND_ASSIGN(EsParserMpeg1Audio); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace mp2t | 85 } // namespace mp2t |
| 86 } // namespace media | 86 } // namespace media |
| 87 | 87 |
| 88 #endif // MEDIA_FORMATS_MP2T_ES_PARSER_MPEG1AUDIO_H_ | 88 #endif // MEDIA_FORMATS_MP2T_ES_PARSER_MPEG1AUDIO_H_ |
| OLD | NEW |