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

Unified Diff: media/filters/ffmpeg_aac_bitstream_converter.h

Issue 691233002: Added aac bitstream converter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Figured it out Created 6 years, 1 month 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
« no previous file with comments | « media/BUILD.gn ('k') | media/filters/ffmpeg_aac_bitstream_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_aac_bitstream_converter.h
diff --git a/media/filters/ffmpeg_aac_bitstream_converter.h b/media/filters/ffmpeg_aac_bitstream_converter.h
new file mode 100644
index 0000000000000000000000000000000000000000..c71f6badb55361aa897c3ac5c32e2f04a8e1736c
--- /dev/null
+++ b/media/filters/ffmpeg_aac_bitstream_converter.h
@@ -0,0 +1,48 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_FILTERS_FFMPEG_AAC_BITSTREAM_CONVERTER_H_
+#define MEDIA_FILTERS_FFMPEG_AAC_BITSTREAM_CONVERTER_H_
+
+#include "base/basictypes.h"
+#include "media/base/media_export.h"
+#include "media/filters/ffmpeg_bitstream_converter.h"
+
+// Forward declarations for FFmpeg datatypes used.
+struct AVCodecContext;
+struct AVPacket;
+
+namespace media {
+
+// Bitstream converter that adds ADTS headers to AAC frames.
+class MEDIA_EXPORT FFmpegAACBitstreamConverter
+ : public FFmpegBitstreamConverter {
+ public:
+ enum { kAdtsHeaderSize = 7 };
+
+ // The |stream_codec_context| will be used during conversion and should be the
+ // AVCodecContext for the stream sourcing these packets. A reference to
+ // |stream_codec_context| is retained, so it must outlive this class.
+ explicit FFmpegAACBitstreamConverter(AVCodecContext* stream_codec_context);
+ ~FFmpegAACBitstreamConverter() override;
damienv1 2014/11/08 03:08:48 virtual ~FFmpegAACBitstreamConverter(); instead ?
+
+ // FFmpegBitstreamConverter implementation.
+ // Uses FFmpeg allocation methods for buffer allocation to ensure
+ // compatibility with FFmpeg's memory management.
+ bool ConvertPacket(AVPacket* packet) override;
damienv1 2014/11/08 03:08:48 Shouldn't this be: virtual ... ?
+
+ private:
+ // Variable to hold a pointer to memory where we can access the global
+ // data from the FFmpeg file format's global headers.
+ AVCodecContext* stream_codec_context_;
+
+ bool header_generated_;
+ uint8_t hdr_[kAdtsHeaderSize];
+
+ DISALLOW_COPY_AND_ASSIGN(FFmpegAACBitstreamConverter);
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_FFMPEG_AAC_BITSTREAM_CONVERTER_H_
« no previous file with comments | « media/BUILD.gn ('k') | media/filters/ffmpeg_aac_bitstream_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698