Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Unified Diff: media/filters/audio_file_reader.h

Issue 311373004: Consolidate and improve audio decoding test for all decoders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. DEPS roll. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/audio_file_reader.h
diff --git a/media/filters/audio_file_reader.h b/media/filters/audio_file_reader.h
index e7b7b4b71f8af84af71ba7e3ef38d6f1517eeaa1..d445a43402ac64ab8b7fb07fbb7cb5f4352d15b4 100644
--- a/media/filters/audio_file_reader.h
+++ b/media/filters/audio_file_reader.h
@@ -8,16 +8,18 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "media/base/media_export.h"
+#include "media/filters/ffmpeg_glue.h"
struct AVCodecContext;
+struct AVDictionary;
struct AVPacket;
+struct AVStream;
namespace base { class TimeDelta; }
namespace media {
class AudioBus;
-class FFmpegGlue;
class FFmpegURLProtocol;
class MEDIA_EXPORT AudioFileReader {
@@ -55,16 +57,31 @@ class MEDIA_EXPORT AudioFileReader {
base::TimeDelta GetDuration() const;
int GetNumberOfFrames() const;
- // Helper methods which allows AudioFileReader to double as a test utility for
- // demuxing audio files. Returns true if a packet could be demuxed from the
- // first audio stream in the file, |output_packet| will contain the demuxed
- // packet then.
+ // The methods below are helper methods which allow AudioFileReader to double
+ // as a test utility for demuxing audio files.
+ // --------------------------------------------------------------------------
+
+ // Returns true if a packet could be demuxed from the first audio stream in
+ // the file, |output_packet| will contain the demuxed packet then.
bool ReadPacketForTesting(AVPacket* output_packet);
+ // Seeks to the given point and returns true if successful. |seek_time| will
+ // be converted to the stream's time base automatically.
+ bool SeekForTesting(base::TimeDelta seek_time);
+
const AVCodecContext* codec_context_for_testing() const {
return codec_context_;
}
+ const AVFormatContext* format_context_for_testing() const {
+ return glue_->format_context();
+ }
+
+ // The stream index of the first audio stream; see AVFormatContext.streams[].
+ const int stream_index_for_testing() const {
+ return stream_index_;
+ }
+
private:
bool ReadPacket(AVPacket* output_packet);

Powered by Google App Engine
This is Rietveld 408576698