| Index: media/filters/ffmpeg_h265_to_annex_b_bitstream_converter.h
|
| diff --git a/media/filters/ffmpeg_aac_bitstream_converter.h b/media/filters/ffmpeg_h265_to_annex_b_bitstream_converter.h
|
| similarity index 53%
|
| copy from media/filters/ffmpeg_aac_bitstream_converter.h
|
| copy to media/filters/ffmpeg_h265_to_annex_b_bitstream_converter.h
|
| index c71f6badb55361aa897c3ac5c32e2f04a8e1736c..5da43e0af2745f539e86e5bc4b3ffcdae479d587 100644
|
| --- a/media/filters/ffmpeg_aac_bitstream_converter.h
|
| +++ b/media/filters/ffmpeg_h265_to_annex_b_bitstream_converter.h
|
| @@ -1,13 +1,15 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright 2015 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_
|
| +#ifndef MEDIA_FILTERS_FFMPEG_H265_TO_ANNEX_B_BITSTREAM_CONVERTER_H_
|
| +#define MEDIA_FILTERS_FFMPEG_H265_TO_ANNEX_B_BITSTREAM_CONVERTER_H_
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| #include "media/base/media_export.h"
|
| #include "media/filters/ffmpeg_bitstream_converter.h"
|
| +#include "media/formats/mp4/box_definitions.h"
|
|
|
| // Forward declarations for FFmpeg datatypes used.
|
| struct AVCodecContext;
|
| @@ -15,34 +17,33 @@ struct AVPacket;
|
|
|
| namespace media {
|
|
|
| -// Bitstream converter that adds ADTS headers to AAC frames.
|
| -class MEDIA_EXPORT FFmpegAACBitstreamConverter
|
| +// Bitstream converter that converts H.265 bitstream based FFmpeg packets into
|
| +// H.265 Annex B bytestream format.
|
| +class MEDIA_EXPORT FFmpegH265ToAnnexBBitstreamConverter
|
| : 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;
|
| + explicit FFmpegH265ToAnnexBBitstreamConverter(
|
| + AVCodecContext* stream_codec_context);
|
| +
|
| + ~FFmpegH265ToAnnexBBitstreamConverter() override;
|
|
|
| // FFmpegBitstreamConverter implementation.
|
| - // Uses FFmpeg allocation methods for buffer allocation to ensure
|
| - // compatibility with FFmpeg's memory management.
|
| bool ConvertPacket(AVPacket* packet) override;
|
|
|
| private:
|
| + scoped_ptr<mp4::HEVCDecoderConfigurationRecord> hevc_config_;
|
| +
|
| // 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);
|
| + DISALLOW_COPY_AND_ASSIGN(FFmpegH265ToAnnexBBitstreamConverter);
|
| };
|
|
|
| } // namespace media
|
|
|
| -#endif // MEDIA_FILTERS_FFMPEG_AAC_BITSTREAM_CONVERTER_H_
|
| +#endif // MEDIA_FILTERS_FFMPEG_H265_TO_ANNEX_B_BITSTREAM_CONVERTER_H_
|
| +
|
|
|