Commit 3e21bd00 authored by darin@chromium.org's avatar darin@chromium.org

Create media.dll / libmedia.so.

This is a re-attempt at landing http://codereview.chromium.org/7572040, now with a DEPS roll to pick up the changes made to ffmpeg by http://codereview.chromium.org/7778004/ so that media_unittests run properly on Linux.

TBR=fischman
Review URL: http://codereview.chromium.org/7775004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98600 0039d316-1c4b-4281-b951-d872f2087c98
parent 80afbdbf
......@@ -27,7 +27,7 @@ vars = {
"libjingle_revision": "77",
"libvpx_revision": "97420",
"ffmpeg_revision": "98072",
"ffmpeg_revision": "98577",
"sfntly_revision": "54",
"skia_revision": "2172",
"v8_revision": "9008",
......
......@@ -75,11 +75,12 @@ class SpeechRecognizerTest : public SpeechRecognizerDelegate,
// testing::Test methods.
virtual void SetUp() {
AudioInputController::set_factory(&audio_input_controller_factory_);
AudioInputController::set_factory_for_testing(
&audio_input_controller_factory_);
}
virtual void TearDown() {
AudioInputController::set_factory(NULL);
AudioInputController::set_factory_for_testing(NULL);
}
void FillPacketWithTestWaveform() {
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -6,11 +6,12 @@
#define MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_
#include "base/time.h"
#include "media/base/media_export.h"
// AudioBuffersState struct stores current state of audio buffers along with
// the timestamp of the moment this state corresponds to. It is used for audio
// synchronization.
struct AudioBuffersState {
struct MEDIA_EXPORT AudioBuffersState {
AudioBuffersState();
AudioBuffersState(int pending_bytes, int hardware_delay_bytes);
......
......@@ -35,7 +35,7 @@
//
namespace media {
class AudioInputController
class MEDIA_EXPORT AudioInputController
: public base::RefCountedThreadSafe<AudioInputController>,
public AudioInputStream::AudioInputCallback {
public:
......@@ -99,10 +99,8 @@ class AudioInputController
// Sets the factory used by the static method Create. AudioInputController
// does not take ownership of |factory|. A value of NULL results in an
// AudioInputController being created directly.
#if defined(UNIT_TEST)
static void set_factory(Factory* factory) { factory_ = factory; }
AudioInputStream* stream() { return stream_; }
#endif
static void set_factory_for_testing(Factory* factory) { factory_ = factory; }
AudioInputStream* stream_for_testing() { return stream_; }
// Starts recording in this audio input stream.
virtual void Record();
......
......@@ -139,7 +139,7 @@ TEST(AudioInputControllerTest, RecordAndError) {
event.Reset();
// Wait for the stream to be stopped.
AudioInputStream* stream = controller->stream();
AudioInputStream* stream = controller->stream_for_testing();
stream->Stop();
event.Wait();
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -45,13 +45,13 @@
// as the data is written to the audio device. Size of each packet is determined
// by |samples_per_packet| specified in AudioParameters when the stream is
// created.
class AudioOutputStream {
class MEDIA_EXPORT AudioOutputStream {
public:
// Audio sources must implement AudioSourceCallback. This interface will be
// called in a random thread which very likely is a high priority thread. Do
// not rely on using this thread TLS or make calls that alter the thread
// itself such as creating Windows or initializing COM.
class AudioSourceCallback {
class MEDIA_EXPORT AudioSourceCallback {
public:
virtual ~AudioSourceCallback() {}
......@@ -104,7 +104,7 @@ class AudioOutputStream {
// Models an audio sink receiving recorded audio from the audio driver.
class AudioInputStream {
public:
class AudioInputCallback {
class MEDIA_EXPORT AudioInputCallback {
public:
virtual ~AudioInputCallback() {}
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -21,7 +21,7 @@ class MessageLoop;
// Manages all audio resources. In particular it owns the AudioOutputStream
// objects. Provides some convenience functions that avoid the need to provide
// iterators over the existing streams.
class AudioManager {
class MEDIA_EXPORT AudioManager {
public:
// Returns true if the OS reports existence of audio devices. This does not
// guarantee that the existing devices support all formats and sample rates.
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -13,7 +13,7 @@
class AudioOutputDispatcher;
// AudioManagerBase provides AudioManager functions common for all platforms.
class AudioManagerBase : public AudioManager {
class MEDIA_EXPORT AudioManagerBase : public AudioManager {
public:
// Name of the generic "default" device.
static const char kDefaultDeviceName[];
......
......@@ -49,7 +49,7 @@ class Task;
//
namespace media {
class AudioOutputController
class MEDIA_EXPORT AudioOutputController
: public base::RefCountedThreadSafe<AudioOutputController>,
public AudioOutputStream::AudioSourceCallback {
public:
......
......@@ -33,7 +33,7 @@
class AudioOutputStream;
class MessageLoop;
class AudioOutputDispatcher
class MEDIA_EXPORT AudioOutputDispatcher
: public base::RefCountedThreadSafe<AudioOutputDispatcher> {
public:
// |close_delay_ms| specifies delay after the stream is paused until
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -20,7 +20,7 @@ class AudioOutputDispatcher;
//
// AudioOutputProxy uses AudioOutputDispatcher to open and close
// physical output streams.
class AudioOutputProxy : public AudioOutputStream {
class MEDIA_EXPORT AudioOutputProxy : public AudioOutputStream {
public:
// Caller keeps ownership of |dispatcher|.
AudioOutputProxy(AudioOutputDispatcher* dispatcher);
......
......@@ -7,10 +7,11 @@
#include "base/basictypes.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/media_export.h"
struct AudioParameters {
struct MEDIA_EXPORT AudioParameters {
// Compare is useful when AudioParameters is used as a key in std::map.
class Compare {
class MEDIA_EXPORT Compare {
public:
bool operator()(const AudioParameters& a, const AudioParameters& b) const;
};
......@@ -19,7 +20,7 @@ struct AudioParameters {
AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples.
AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested.
AUDIO_MOCK, // Creates a dummy AudioOutputStream object.
AUDIO_LAST_FORMAT // Only used for validation of format.
AUDIO_LAST_FORMAT // Only used for validation of format.y
};
// Telephone quality sample rate, mostly for speech-only audio.
......
......@@ -8,6 +8,7 @@
#include <vector>
#include "base/basictypes.h"
#include "media/base/media_export.h"
namespace base {
class SharedMemory;
......@@ -30,11 +31,11 @@ namespace media {
// formats.
// The buffer is modified in-place to avoid memory management, as this
// function may be called in performance critical code.
bool AdjustVolume(void* buf,
size_t buflen,
int channels,
int bytes_per_sample,
float volume);
MEDIA_EXPORT bool AdjustVolume(void* buf,
size_t buflen,
int channels,
int bytes_per_sample,
float volume);
// FoldChannels() does a software multichannel folding down to stereo.
// Channel order is assumed to be 5.1 Dolby standard which is
......@@ -49,11 +50,11 @@ bool AdjustVolume(void* buf,
// volume.
// The buffer is modified in-place to avoid memory management, as this
// function may be called in performance critical code.
bool FoldChannels(void* buf,
size_t buflen,
int channels,
int bytes_per_sample,
float volume);
MEDIA_EXPORT bool FoldChannels(void* buf,
size_t buflen,
int channels,
int bytes_per_sample,
float volume);
// DeinterleaveAudioChannel() takes interleaved audio buffer |source|
// of the given |sample_fmt| and |number_of_channels| and extracts
......@@ -74,23 +75,23 @@ bool DeinterleaveAudioChannel(void* source,
// The size of the |source| vector determines the number of channels.
// The |destination| buffer is assumed to be large enough to hold the
// result. Thus it must be at least size: number_of_frames * source.size()
void InterleaveFloatToInt16(const std::vector<float*>& source,
int16* destination,
size_t number_of_frames);
MEDIA_EXPORT void InterleaveFloatToInt16(const std::vector<float*>& source,
int16* destination,
size_t number_of_frames);
// Returns the default audio hardware sample-rate.
double GetAudioHardwareSampleRate();
MEDIA_EXPORT double GetAudioHardwareSampleRate();
// Functions that handle data buffer passed between processes in the shared
// memory. Called on both IPC sides.
uint32 TotalSharedMemorySizeInBytes(uint32 packet_size);
uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size);
uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory,
uint32 shared_memory_size);
void SetActualDataSizeInBytes(base::SharedMemory* shared_memory,
uint32 shared_memory_size,
uint32 actual_data_size);
MEDIA_EXPORT uint32 TotalSharedMemorySizeInBytes(uint32 packet_size);
MEDIA_EXPORT uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size);
MEDIA_EXPORT uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory,
uint32 shared_memory_size);
MEDIA_EXPORT void SetActualDataSizeInBytes(base::SharedMemory* shared_memory,
uint32 shared_memory_size,
uint32 actual_data_size);
} // namespace media
......
......@@ -15,7 +15,7 @@
#include "media/audio/audio_io.h"
#include "media/audio/audio_parameters.h"
class FakeAudioOutputStream : public AudioOutputStream {
class MEDIA_EXPORT FakeAudioOutputStream : public AudioOutputStream {
public:
static AudioOutputStream* MakeFakeStream(const AudioParameters& params);
static FakeAudioOutputStream* GetLastFakeStream();
......
......@@ -46,7 +46,7 @@ class AlsaWrapper;
class AudioManagerLinux;
class MessageLoop;
class AlsaPcmOutputStream : public AudioOutputStream {
class MEDIA_EXPORT AlsaPcmOutputStream : public AudioOutputStream {
public:
// String for the generic "default" ALSA device that has the highest
// compatibility and chance of working.
......@@ -219,4 +219,7 @@ class AlsaPcmOutputStream : public AudioOutputStream {
DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStream);
};
MEDIA_EXPORT std::ostream& operator<<(std::ostream& os,
AlsaPcmOutputStream::InternalState);
#endif // MEDIA_AUDIO_LINUX_ALSA_OUTPUT_H_
......@@ -9,8 +9,9 @@
#include <alsa/asoundlib.h>
#include "base/basictypes.h"
#include "media/base/media_export.h"
class AlsaWrapper {
class MEDIA_EXPORT AlsaWrapper {
public:
AlsaWrapper();
virtual ~AlsaWrapper();
......
......@@ -13,7 +13,7 @@
class AlsaWrapper;
class AudioManagerLinux : public AudioManagerBase {
class MEDIA_EXPORT AudioManagerLinux : public AudioManagerBase {
public:
AudioManagerLinux();
......
......@@ -11,7 +11,8 @@
#include "media/base/seekable_buffer.h"
// An audio source that produces a pure sinusoidal tone.
class SineWaveAudioSource : public AudioOutputStream::AudioSourceCallback {
class MEDIA_EXPORT SineWaveAudioSource
: public AudioOutputStream::AudioSourceCallback {
public:
enum Format {
FORMAT_8BIT_LINEAR_PCM,
......@@ -39,7 +40,7 @@ class SineWaveAudioSource : public AudioOutputStream::AudioSourceCallback {
// Defines an interface for pushing audio output. In contrast, the interfaces
// defined by AudioSourceCallback are pull model only.
class PushAudioOutput {
class MEDIA_EXPORT PushAudioOutput {
public:
virtual ~PushAudioOutput() {}
......@@ -56,7 +57,7 @@ class PushAudioOutput {
// a pull model provider AudioSourceCallback. Fundamentally it manages a series
// of audio buffers and is unaware of the actual audio format.
// Note that the PushSource is not thread safe and user need to provide locking.
class PushSource
class MEDIA_EXPORT PushSource
: public AudioOutputStream::AudioSourceCallback,
public PushAudioOutput {
public:
......
......@@ -46,7 +46,7 @@ namespace media {
// the BuildRequest should be in a state where it can be deleted from inside
// this call. If an error occurs during the build process, RequestComplete()
// can also be called to signal the error.
class AsyncDataSourceFactoryBase : public DataSourceFactory {
class MEDIA_EXPORT AsyncDataSourceFactoryBase : public DataSourceFactory {
public:
AsyncDataSourceFactoryBase();
virtual ~AsyncDataSourceFactoryBase();
......@@ -64,7 +64,7 @@ class AsyncDataSourceFactoryBase : public DataSourceFactory {
virtual DataSourceFactory* Clone() const = 0;
protected:
class BuildRequest {
class MEDIA_EXPORT BuildRequest {
public:
BuildRequest(const std::string& url, BuildCallback* callback);
virtual ~BuildRequest();
......
......@@ -30,13 +30,15 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/time.h"
#include "media/base/media_export.h"
namespace media {
// Indicates an invalid or missing timestamp.
extern const base::TimeDelta kNoTimestamp;
MEDIA_EXPORT extern const base::TimeDelta kNoTimestamp;
class StreamSample : public base::RefCountedThreadSafe<StreamSample> {
class MEDIA_EXPORT StreamSample
: public base::RefCountedThreadSafe<StreamSample> {
public:
// Returns the timestamp of this buffer in microseconds.
base::TimeDelta GetTimestamp() const {
......@@ -76,7 +78,7 @@ class StreamSample : public base::RefCountedThreadSafe<StreamSample> {
};
class Buffer : public StreamSample {
class MEDIA_EXPORT Buffer : public StreamSample {
public:
// Returns a read only pointer to the buffer data.
virtual const uint8* GetData() const = 0;
......
......@@ -24,10 +24,11 @@
#include "base/callback_old.h"
#include "base/memory/scoped_ptr.h"
#include "base/task.h"
#include "media/base/media_export.h"
namespace media {
class AutoCallbackRunner {
class MEDIA_EXPORT AutoCallbackRunner {
public:
// Takes ownership of the callback.
explicit AutoCallbackRunner(Callback0::Type* callback)
......
......@@ -5,6 +5,8 @@
#ifndef MEDIA_BASE_CHANNEL_LAYOUT_H_
#define MEDIA_BASE_CHANNEL_LAYOUT_H_
#include "media/base/media_export.h"
enum ChannelLayout {
CHANNEL_LAYOUT_NONE = 0,
CHANNEL_LAYOUT_UNSUPPORTED,
......@@ -84,6 +86,6 @@ enum Channels {
extern const int kChannelOrderings[CHANNEL_LAYOUT_MAX][CHANNELS_MAX];
// Returns the number of channels in a given ChannelLayout.
int ChannelLayoutToChannelCount(ChannelLayout layout);
MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout);
#endif // MEDIA_BASE_CHANNEL_LAYOUT_H_
......@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "media/base/media_export.h"
namespace media {
......@@ -24,7 +25,7 @@ namespace media {
// TODO(scherkus): Clock will some day be responsible for executing callbacks
// given a media time. This will be used primarily by video renderers. For now
// we'll keep using a poll-and-sleep solution.
class Clock {
class MEDIA_EXPORT Clock {
public:
// Type for a static function pointer that acts as a time source.
typedef base::Time(TimeProvider)();
......
......@@ -13,7 +13,8 @@
namespace media {
class CompositeDataSourceFactory : public AsyncDataSourceFactoryBase {
class MEDIA_EXPORT CompositeDataSourceFactory
: public AsyncDataSourceFactoryBase {
public:
CompositeDataSourceFactory();
virtual ~CompositeDataSourceFactory();
......
......@@ -15,7 +15,7 @@ class MessageLoop;
namespace media {
class CompositeFilter : public Filter {
class MEDIA_EXPORT CompositeFilter : public Filter {
public:
explicit CompositeFilter(MessageLoop* message_loop);
......
......@@ -15,7 +15,7 @@
namespace media {
class DataBuffer : public Buffer {
class MEDIA_EXPORT DataBuffer : public Buffer {
public:
// Takes ownership of the passed |buffer|, assumes valid data of size
// |buffer_size|.
......
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -6,6 +6,7 @@
#define MEDIA_BASE_DJB2_H_
#include "base/basictypes.h"
#include "media/base/media_export.h"
// DJB2 is a hash algorithm with excellent distribution and speed
// on many different sets.
......@@ -34,7 +35,7 @@ static const uint32 kDJB2HashSeed = 5381u;
// For the given buffer of data, compute the DJB2 hash of
// the data. You can call this any number of times during the computation.
uint32 DJB2Hash(const void* buf, size_t len, uint32 seed);
MEDIA_EXPORT uint32 DJB2Hash(const void* buf, size_t len, uint32 seed);
#endif // MEDIA_BASE_DJB2_H_
......@@ -15,7 +15,7 @@ namespace media {
// This is a collection of Filter objects used to form a media playback
// pipeline. See src/media/base/pipeline.h for more information.
class FilterCollection {
class MEDIA_EXPORT FilterCollection {
public:
FilterCollection();
~FilterCollection();
......
......@@ -8,6 +8,7 @@
#include<string>
#include "base/callback_old.h"
#include "media/base/media_export.h"
#include "media/base/pipeline_status.h"
namespace media {
......@@ -15,7 +16,7 @@ namespace media {
class DataSource;
// Asynchronous factory interface for building DataSource objects.
class DataSourceFactory {
class MEDIA_EXPORT DataSourceFactory {
public:
// Ownership of the DataSource is transferred through this callback.
typedef Callback2<PipelineStatus, DataSource*>::Type BuildCallback;
......@@ -33,7 +34,7 @@ class DataSourceFactory {
class Demuxer;
// Asynchronous factory interface for building Demuxer objects.
class DemuxerFactory {
class MEDIA_EXPORT DemuxerFactory {
public:
// Ownership of the Demuxer is transferred through this callback.
typedef Callback2<PipelineStatus, Demuxer*>::Type BuildCallback;
......
......@@ -22,7 +22,7 @@
namespace media {
class FilterHost {
class MEDIA_EXPORT FilterHost {
public:
// Stops execution of the pipeline due to a fatal error. Do not call this
// method with PIPELINE_OK.
......
......@@ -32,6 +32,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/media_export.h"
#include "media/base/pipeline_status.h"
#include "media/base/video_frame.h"
......@@ -67,12 +68,12 @@ typedef base::Callback<void(PipelineStatus)> FilterStatusCB;
// This function copies |cb|, calls Reset() on |cb|, and then calls Run()
// on the copy. This is used in the common case where you need to clear
// a callback member variable before running the callback.
void ResetAndRunCB(FilterStatusCB* cb, PipelineStatus status);
MEDIA_EXPORT void ResetAndRunCB(FilterStatusCB* cb, PipelineStatus status);
// Used for updating pipeline statistics.
typedef Callback1<const PipelineStatistics&>::Type StatisticsCallback;
class Filter : public base::RefCountedThreadSafe<Filter> {
class MEDIA_EXPORT Filter : public base::RefCountedThreadSafe<Filter> {
public:
Filter();
......@@ -130,7 +131,7 @@ class Filter : public base::RefCountedThreadSafe<Filter> {
DISALLOW_COPY_AND_ASSIGN(Filter);
};
class DataSource : public Filter {
class MEDIA_EXPORT DataSource : public Filter {
public:
typedef Callback1<size_t>::Type ReadCallback;
static const size_t kReadError = static_cast<size_t>(-1);
......@@ -155,7 +156,8 @@ class DataSource : public Filter {
virtual void SetPreload(Preload preload) = 0;
};
class DemuxerStream : public base::RefCountedThreadSafe<DemuxerStream> {
class MEDIA_EXPORT DemuxerStream
: public base::RefCountedThreadSafe<DemuxerStream> {
public:
typedef base::Callback<void(Buffer*)> ReadCallback;
......@@ -183,7 +185,7 @@ class DemuxerStream : public base::RefCountedThreadSafe<DemuxerStream> {
virtual ~DemuxerStream();
};
class Demuxer : public Filter {
class MEDIA_EXPORT Demuxer : public Filter {
public:
// Returns the given stream type, or NULL if that type is not present.
virtual scoped_refptr<DemuxerStream> GetStream(DemuxerStream::Type type) = 0;
......@@ -196,7 +198,7 @@ class Demuxer : public Filter {
};
class VideoDecoder : public Filter {
class MEDIA_EXPORT VideoDecoder : public Filter {
public:
// Initialize a VideoDecoder with the given DemuxerStream, executing the
// callback upon completion.
......@@ -245,7 +247,7 @@ class VideoDecoder : public Filter {
};
class AudioDecoder : public Filter {
class MEDIA_EXPORT AudioDecoder : public Filter {
public:
// Initialize a AudioDecoder with the given DemuxerStream, executing the
// callback upon completion.
......@@ -280,7 +282,7 @@ class AudioDecoder : public Filter {
};
class VideoRenderer : public Filter {
class MEDIA_EXPORT VideoRenderer : public Filter {
public:
// Initialize a VideoRenderer with the given VideoDecoder, executing the
// callback upon completion.
......@@ -293,7 +295,7 @@ class VideoRenderer : public Filter {
};
class AudioRenderer : public Filter {
class MEDIA_EXPORT AudioRenderer : public Filter {
public:
// Initialize a AudioRenderer with the given AudioDecoder, executing the
// callback upon completion.
......
......@@ -6,13 +6,14 @@
#define MEDIA_BASE_H264_BITSTREAM_CONVERTER_H_
#include "base/basictypes.h"
#include "media/base/media_export.h"
namespace media {
// H264BitstreamConverter is a class to convert H.264 bitstream from
// MP4 format (as specified in ISO/IEC 14496-15) into H.264 bytestream
// (as specified in ISO/IEC 14496-10 Annex B).
class H264BitstreamConverter {
class MEDIA_EXPORT H264BitstreamConverter {
public:
H264BitstreamConverter();
~H264BitstreamConverter();
......
......@@ -8,6 +8,8 @@
#ifndef MEDIA_BASE_MEDIA_H_
#define MEDIA_BASE_MEDIA_H_
#include "media/base/media_export.h"
class FilePath;
namespace media {
......@@ -23,16 +25,16 @@ namespace media {
// of the process.
//
// Returns true if everything was successfully initialized, false otherwise.
bool InitializeMediaLibrary(const FilePath& module_dir);
MEDIA_EXPORT bool InitializeMediaLibrary(const FilePath& module_dir);
// Helper function for unit tests to avoid boiler plate code everywhere. This
// function will crash if it fails to load the media library. This ensures tests
// fail if the media library is not available.
void InitializeMediaLibraryForTesting();
MEDIA_EXPORT void InitializeMediaLibraryForTesting();
// Use this if you need to check whether the media library is initialized
// for the this process, without actually trying to initialize it.
bool IsMediaLibraryInitialized();
MEDIA_EXPORT bool IsMediaLibraryInitialized();
// Attempts to initialize OpenMAX library.
//
......
// Copyright (c) 2011 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_BASE_MEDIA_EXPORT_H_
#define MEDIA_BASE_MEDIA_EXPORT_H_
#pragma once
// Defines MEDIA_EXPORT so that functionality implemented by the Media module
// can be exported to consumers.
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(MEDIA_IMPLEMENTATION)
#define MEDIA_EXPORT __declspec(dllexport)
#else
#define MEDIA_EXPORT __declspec(dllimport)
#endif // defined(MEDIA_IMPLEMENTATION)
#else // defined(WIN32)
#define MEDIA_EXPORT __attribute__((visibility("default")))
#endif
#else // defined(COMPONENT_BUILD)
#define MEDIA_EXPORT
#endif
#endif // MEDIA_BASE_MEDIA_EXPORT_H_
......@@ -8,13 +8,14 @@
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
#include "media/base/media_export.h"
#include "media/base/media_log_event.h"
#include "media/base/pipeline_impl.h"
#include "media/base/pipeline_status.h"
namespace media {
class MediaLog : public base::RefCountedThreadSafe<MediaLog> {
class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
public:
// Convert various enums to strings.
static const char* EventTypeToString(MediaLogEvent::Type type);
......
......@@ -8,6 +8,7 @@
#define MEDIA_BASE_MEDIA_SWITCHES_H_
#include "build/build_config.h"
#include "media/base/media_export.h"
namespace switches {
......@@ -16,9 +17,9 @@ extern const char kAlsaOutputDevice[];
extern const char kAlsaInputDevice[];
#endif
extern const char kEnableAdaptive[];
extern const char kUsePulseAudio[];
extern const char kVideoThreads[];
MEDIA_EXPORT extern const char kEnableAdaptive[];
MEDIA_EXPORT extern const char kUsePulseAudio[];
MEDIA_EXPORT extern const char kVideoThreads[];
} // namespace switches
......
......@@ -10,13 +10,14 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop_proxy.h"
#include "media/base/media_export.h"
class MessageLoop;
namespace media {
// Factory object that manages named MessageLoops.
class MessageLoopFactory {
class MEDIA_EXPORT MessageLoopFactory {
public:
// Get the message loop associated with |name|. A new MessageLoop
// is created if the factory doesn't have one associated with |name|.
......
......@@ -13,7 +13,7 @@
namespace media {
class MessageLoopFactoryImpl : public MessageLoopFactory {
class MEDIA_EXPORT MessageLoopFactoryImpl : public MessageLoopFactory {
public:
MessageLoopFactoryImpl();
......
......@@ -36,7 +36,7 @@ struct PipelineStatistics {
class FilterCollection;
class Pipeline : public base::RefCountedThreadSafe<Pipeline> {
class MEDIA_EXPORT Pipeline : public base::RefCountedThreadSafe<Pipeline> {
public:
// Initializes pipeline. Pipeline takes ownership of all callbacks passed
// into this method.
......
......@@ -35,7 +35,7 @@ class MediaLog;
// the callback to get fired and call status() to see what the callback's
// argument was. This object is for one-time use; call |Callback()| exactly
// once.
class PipelineStatusNotification {
class MEDIA_EXPORT PipelineStatusNotification {
public:
PipelineStatusNotification();
~PipelineStatusNotification();
......@@ -93,7 +93,7 @@ class PipelineStatusNotification {
// If any error ever happens, this object will transition to the "Error" state
// from any state. If Stop() is ever called, this object will transition to
// "Stopped" state.
class PipelineImpl : public Pipeline, public FilterHost {
class MEDIA_EXPORT PipelineImpl : public Pipeline, public FilterHost {
public:
explicit PipelineImpl(MessageLoop* message_loop, MediaLog* media_log);
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -31,10 +31,11 @@
#include <vector>
#include "base/time.h"
#include "media/base/media_export.h"
namespace media {
class PtsHeap {
class MEDIA_EXPORT PtsHeap {
public:
PtsHeap();
~PtsHeap();
......
......@@ -25,7 +25,7 @@ namespace media {
class StreamSample;
class PtsStream {
class MEDIA_EXPORT PtsStream {
public:
PtsStream();
~PtsStream();
......
......@@ -41,7 +41,7 @@
namespace media {
class SeekableBuffer {
class MEDIA_EXPORT SeekableBuffer {
public:
// Constructs an instance with |forward_capacity| and |backward_capacity|.
// The values are in bytes.
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -8,10 +8,11 @@
#include <map>
#include "base/logging.h"
#include "media/base/media_export.h"
namespace media {
class StateMatrix {
class MEDIA_EXPORT StateMatrix {
public:
StateMatrix();
~StateMatrix();
......
......@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "media/base/media_export.h"
namespace media {
......@@ -25,7 +26,7 @@ enum VideoCodec {
// that uses said codec in the same CL.
};
class VideoDecoderConfig {
class MEDIA_EXPORT VideoDecoderConfig {
public:
VideoDecoderConfig(VideoCodec codec, int width, int height,
int surface_width, int surface_height,
......
......@@ -9,7 +9,7 @@
namespace media {
class VideoFrame : public StreamSample {
class MEDIA_EXPORT VideoFrame : public StreamSample {
public:
static const size_t kMaxPlanes = 3;
......
......@@ -6,6 +6,7 @@
#define MEDIA_BASE_VIDEO_UTIL_H_
#include "base/basictypes.h"
#include "media/base/media_export.h"
namespace media {
......@@ -15,9 +16,12 @@ class VideoFrame;
// source and destinations dimensions.
//
// NOTE: rows is *not* the same as height!
void CopyYPlane(const uint8* source, int stride, int rows, VideoFrame* frame);
void CopyUPlane(const uint8* source, int stride, int rows, VideoFrame* frame);
void CopyVPlane(const uint8* source, int stride, int rows, VideoFrame* frame);
MEDIA_EXPORT void CopyYPlane(const uint8* source, int stride, int rows,
VideoFrame* frame);
MEDIA_EXPORT void CopyUPlane(const uint8* source, int stride, int rows,
VideoFrame* frame);
MEDIA_EXPORT void CopyVPlane(const uint8* source, int stride, int rows,
VideoFrame* frame);
} // namespace media
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -93,6 +93,7 @@ void ConvertYUY2ToYUV(const uint8* src,
uint8* vplane,
int width,
int height);
} // namespace media
#endif // MEDIA_BASE_YUV_CONVERT_H_
......@@ -12,6 +12,7 @@
#include "base/memory/singleton.h"
#include "base/time.h"
#include "media/base/channel_layout.h"
#include "media/base/media_export.h"
#include "media/video/video_decode_engine.h"
// Include FFmpeg header files.
......@@ -54,15 +55,15 @@ class ScopedPtrAVFreePacket {
// For example if |timestamp| equals 11025 and |time_base| equals {1, 44100}
// then the return value will be a base::TimeDelta for 0.25 seconds since that
// is how much time 11025/44100ths of a second represents.
base::TimeDelta ConvertFromTimeBase(const AVRational& time_base,
int64 timestamp);
MEDIA_EXPORT base::TimeDelta ConvertFromTimeBase(const AVRational& time_base,
int64 timestamp);
// Converts a base::TimeDelta into an int64 timestamp in |time_base| units.
// For example if |timestamp| is 0.5 seconds and |time_base| is {1, 44100}, then
// the return value will be 22050 since that is how many 1/44100ths of a second
// represent 0.5 seconds.
int64 ConvertToTimeBase(const AVRational& time_base,
const base::TimeDelta& timestamp);
MEDIA_EXPORT int64 ConvertToTimeBase(const AVRational& time_base,
const base::TimeDelta& timestamp);
VideoCodec CodecIDToVideoCodec(CodecID codec_id);
CodecID VideoCodecToCodecID(VideoCodec video_codec);
......@@ -80,9 +81,9 @@ base::TimeDelta GetFrameDuration(AVStream* stream);
// Returns true if a valid seek point was found after |timestamp| and
// |seek_time| was set. Returns false if a seek point could not be
// found or the parameters are invalid.
bool GetSeekTimeAfter(AVStream* stream,
const base::TimeDelta& timestamp,
base::TimeDelta* seek_time);
MEDIA_EXPORT bool GetSeekTimeAfter(AVStream* stream,
const base::TimeDelta& timestamp,
base::TimeDelta* seek_time);
// Get the number of bytes required to play the stream over a specified
// time range. This is an estimate based on the available index data.
......@@ -97,12 +98,12 @@ bool GetSeekTimeAfter(AVStream* stream,
// |range_end| - The end time for the range covered by |bytes|. This may be
// different than |end_time| if the index doesn't have data for
// that exact time. |range_end| >= |end_time|
bool GetStreamByteCountOverRange(AVStream* stream,
const base::TimeDelta& start_time,
const base::TimeDelta& end_time,
int64* bytes,
base::TimeDelta* range_start,
base::TimeDelta* range_end);
MEDIA_EXPORT bool GetStreamByteCountOverRange(AVStream* stream,
const base::TimeDelta& start_time,
const base::TimeDelta& end_time,
int64* bytes,
base::TimeDelta* range_start,
base::TimeDelta* range_end);
// Calculates the width and height of the video surface using the video's
// encoded dimensions and sample_aspect_ratio.
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
//
......@@ -8,7 +8,9 @@
#ifndef MEDIA_FFMPEG_FILE_PROTOCOL_H_
#define MEDIA_FFMPEG_FILE_PROTOCOL_H_
#include "media/base/media_export.h"
struct URLProtocol;
extern URLProtocol kFFmpegFileProtocol;
MEDIA_EXPORT extern URLProtocol kFFmpegFileProtocol;
#endif // MEDIA_FFMPEG_FILE_PROTOCOL_H_
......@@ -242,7 +242,7 @@ class AdaptiveDemuxer : public Demuxer {
// DemuxerFactory's Build() method individually. For backward-compatibility,
// the manifest URL may also simply be a regular URL in which case an implicit
// "x-adaptive:0:0:" is prepended.
class AdaptiveDemuxerFactory : public DemuxerFactory {
class MEDIA_EXPORT AdaptiveDemuxerFactory : public DemuxerFactory {
public:
// Takes a reference to |demuxer_factory|.
AdaptiveDemuxerFactory(DemuxerFactory* delegate_factory);
......@@ -260,6 +260,11 @@ class AdaptiveDemuxerFactory : public DemuxerFactory {
DISALLOW_IMPLICIT_CONSTRUCTORS(AdaptiveDemuxerFactory);
};
// See AdaptiveDemuxerFactory's class-level comment for |url|'s format.
MEDIA_EXPORT bool ParseAdaptiveUrl(
const std::string& url, int* audio_index, int* video_index,
std::vector<std::string>* urls);
} // namespace media
#endif // MEDIA_FILTERS_ADAPTIVE_DEMUXER_H_
......@@ -8,10 +8,6 @@
namespace media {
bool ParseAdaptiveUrl(
const std::string& url, int* audio_index, int* video_index,
std::vector<std::string>* urls);
TEST(ParseAdaptiveUrlTest, BackwardsCompatible) {
std::string manifest = "http://youtube.com/video.webm";
int audio_index;
......
......@@ -18,7 +18,7 @@ namespace media {
class FFmpegURLProtocol;
class AudioFileReader {
class MEDIA_EXPORT AudioFileReader {
public:
// Audio file data will be read using the given protocol.
// The AudioFileReader does not take ownership of |protocol| and
......
......@@ -34,7 +34,7 @@ namespace media {
class Buffer;
class AudioRendererAlgorithmBase {
class MEDIA_EXPORT AudioRendererAlgorithmBase {
public:
// Used to simplify callback declarations.
typedef Callback0::Type RequestReadCallback;
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.
......@@ -19,7 +19,8 @@
namespace media {
class AudioRendererAlgorithmOLA : public AudioRendererAlgorithmBase {
class MEDIA_EXPORT AudioRendererAlgorithmOLA
: public AudioRendererAlgorithmBase {
public:
AudioRendererAlgorithmOLA();
virtual ~AudioRendererAlgorithmOLA();
......
......@@ -27,7 +27,7 @@
namespace media {
class AudioRendererBase : public AudioRenderer {
class MEDIA_EXPORT AudioRendererBase : public AudioRenderer {
public:
AudioRendererBase();
virtual ~AudioRendererBase();
......
......@@ -24,7 +24,7 @@
namespace media {
class AudioRendererImpl
class MEDIA_EXPORT AudioRendererImpl
: public AudioRendererBase,
public AudioOutputStream::AudioSourceCallback {
public:
......
......@@ -14,6 +14,7 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "media/base/media_export.h"
// FFmpeg types.
struct AVBitStreamFilterContext;
......@@ -22,7 +23,7 @@ struct AVPacket;
namespace media {
class BitstreamConverter {
class MEDIA_EXPORT BitstreamConverter {
public:
BitstreamConverter() {}
virtual ~BitstreamConverter() {}
......@@ -53,7 +54,7 @@ class IdentityBitstreamConverter : public BitstreamConverter {
DISALLOW_COPY_AND_ASSIGN(IdentityBitstreamConverter);
};
class FFmpegBitstreamConverter : public BitstreamConverter {
class MEDIA_EXPORT FFmpegBitstreamConverter : public BitstreamConverter {
public:
// Creates FFmpegBitstreamConverter based on the FFmpeg bistream filter
// corresponding to |filter_name|.
......
......@@ -21,7 +21,7 @@ class FFmpegURLProtocol;
// Demuxer implementation that allows chunks of WebM media data to be passed
// from JavaScript to the media stack.
class ChunkDemuxer : public Demuxer {
class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
public:
explicit ChunkDemuxer(ChunkDemuxerClient* client);
virtual ~ChunkDemuxer();
......
......@@ -20,7 +20,7 @@ class ChunkDemuxerClient;
// All other URLs are delegated to |delegate_factory_|. The url passed to
// the constructor represents the "special" URL that indicates that the
// ChunkDemuxer should be used for playback.
class ChunkDemuxerFactory : public DemuxerFactory {
class MEDIA_EXPORT ChunkDemuxerFactory : public DemuxerFactory {
public:
// Takes ownership of |delegate_factory|.
ChunkDemuxerFactory(const std::string& url, DemuxerFactory* delegate_factory,
......
......@@ -12,7 +12,7 @@
namespace media {
class DummyDemuxerFactory : public DemuxerFactory {
class MEDIA_EXPORT DummyDemuxerFactory : public DemuxerFactory {
public:
DummyDemuxerFactory(bool has_video, bool has_audio);
virtual ~DummyDemuxerFactory();
......
......@@ -14,7 +14,8 @@ namespace media {
// Forward declaration for scoped_ptr_malloc.
class ScopedPtrAVFree;
class FFmpegAudioDecoder : public DecoderBase<AudioDecoder, Buffer> {
class MEDIA_EXPORT FFmpegAudioDecoder
: public DecoderBase<AudioDecoder, Buffer> {
public:
explicit FFmpegAudioDecoder(MessageLoop* message_loop);
virtual ~FFmpegAudioDecoder();
......
......@@ -125,7 +125,7 @@ class FFmpegDemuxerStream : public DemuxerStream {
DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxerStream);
};
class FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol {
class MEDIA_EXPORT FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol {
public:
explicit FFmpegDemuxer(MessageLoop* message_loop);
virtual ~FFmpegDemuxer();
......
......@@ -15,7 +15,7 @@ class MessageLoop;
namespace media {
class FFmpegDemuxerFactory : public DemuxerFactory {
class MEDIA_EXPORT FFmpegDemuxerFactory : public DemuxerFactory {
public:
// Takes ownership of |data_source_factory|, but not of |loop|.
FFmpegDemuxerFactory(DataSourceFactory* data_source_factory,
......
......@@ -31,12 +31,13 @@
#include "base/memory/singleton.h"
#include "base/synchronization/lock.h"
#include "media/base/media_export.h"
struct URLProtocol;
namespace media {
class FFmpegURLProtocol {
class MEDIA_EXPORT FFmpegURLProtocol {
public:
FFmpegURLProtocol() {}
......@@ -64,7 +65,7 @@ class FFmpegURLProtocol {
DISALLOW_COPY_AND_ASSIGN(FFmpegURLProtocol);
};
class FFmpegGlue {
class MEDIA_EXPORT FFmpegGlue {
public:
// Returns the singleton instance.
static FFmpegGlue* GetInstance();
......
......@@ -35,7 +35,7 @@ namespace media {
// FFmpegH264BitstreamConverter uses FFmpeg allocation methods for buffer
// allocation to ensure compatibility with FFmpeg's memory management.
class FFmpegH264BitstreamConverter : public BitstreamConverter {
class MEDIA_EXPORT FFmpegH264BitstreamConverter : public BitstreamConverter {
public:
// The |stream_context| will be used during conversion and should be the
// AVCodecContext for the stream sourcing these packets. A reference to
......
......@@ -19,7 +19,7 @@ namespace media {
class VideoDecodeEngine;
class FFmpegVideoDecoder
class MEDIA_EXPORT FFmpegVideoDecoder
: public VideoDecoder,
public VideoDecodeEngine::EventHandler {
public:
......
......@@ -15,7 +15,7 @@ namespace media {
// Basic data source that treats the URL as a file path, and uses the file
// system to read data for a media pipeline.
class FileDataSource : public DataSource {
class MEDIA_EXPORT FileDataSource : public DataSource {
public:
FileDataSource();
virtual ~FileDataSource();
......
......@@ -9,7 +9,7 @@
namespace media {
class FileDataSourceFactory : public DataSourceFactory {
class MEDIA_EXPORT FileDataSourceFactory : public DataSourceFactory {
public:
FileDataSourceFactory();
virtual ~FileDataSourceFactory();
......
......@@ -5,9 +5,8 @@
#ifndef MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_
#define MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_
#include "media/filters/ffmpeg_glue.h"
#include "base/basictypes.h"
#include "media/filters/ffmpeg_glue.h"
namespace media {
......@@ -16,7 +15,7 @@ namespace media {
// buffer pointer passed into the constructor
// needs to remain valid for the entire lifetime of
// this object.
class InMemoryUrlProtocol : public FFmpegURLProtocol {
class MEDIA_EXPORT InMemoryUrlProtocol : public FFmpegURLProtocol {
public:
InMemoryUrlProtocol(const uint8* buf, int64 size, bool streaming);
virtual ~InMemoryUrlProtocol();
......
......@@ -23,7 +23,7 @@
namespace media {
class NullAudioRenderer
class MEDIA_EXPORT NullAudioRenderer
: public AudioRendererBase,
public base::PlatformThread::Delegate {
public:
......
......@@ -29,7 +29,7 @@ namespace media {
// TODO(scherkus): to avoid subclasses, consider using a peer/delegate interface
// and pass in a reference to the constructor.
class VideoRendererBase
class MEDIA_EXPORT VideoRendererBase
: public VideoRenderer,
public base::PlatformThread::Delegate {
public:
......
......@@ -11,7 +11,7 @@
'targets': [
{
'target_name': 'media',
'type': 'static_library',
'type': '<(component)',
'dependencies': [
'yuv_convert',
'../base/base.gyp:base',
......@@ -19,6 +19,10 @@
'../build/temp_gyp/googleurl.gyp:googleurl',
'../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
'../third_party/openmax/openmax.gyp:il',
'../ui/ui.gyp:ui',
],
'defines': [
'MEDIA_IMPLEMENTATION',
],
'include_dirs': [
'..',
......@@ -108,6 +112,7 @@
'base/h264_bitstream_converter.cc',
'base/h264_bitstream_converter.h',
'base/media.h',
'base/media_export.h',
'base/media_log.cc',
'base/media_log.h',
'base/media_log_event.h',
......@@ -421,6 +426,7 @@
'dependencies': [
'media',
'media_test_support',
'yuv_convert',
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
'../base/base.gyp:test_support_base',
......@@ -529,6 +535,7 @@
'type': 'executable',
'dependencies': [
'media',
'yuv_convert',
'../base/base.gyp:base',
'../skia/skia.gyp:skia',
],
......@@ -575,7 +582,9 @@
'type': 'executable',
'dependencies': [
'media',
'yuv_convert',
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
],
'include_dirs': [
'<(DEPTH)/third_party/wtl/include',
......@@ -627,6 +636,7 @@
'type': 'executable',
'dependencies': [
'media',
'yuv_convert',
'../base/base.gyp:base',
],
'include_dirs': [
......@@ -652,6 +662,7 @@
'type': 'executable',
'dependencies': [
'media',
'yuv_convert',
'../base/base.gyp:base',
'../ui/gfx/gl/gl.gyp:gl',
],
......@@ -718,6 +729,7 @@
'type': 'executable',
'dependencies': [
'media',
'yuv_convert',
'../base/base.gyp:base',
'../ui/gfx/gl/gl.gyp:gl',
],
......
......@@ -16,7 +16,7 @@
namespace media {
class FakeVideoCaptureDevice : public VideoCaptureDevice {
class MEDIA_EXPORT FakeVideoCaptureDevice : public VideoCaptureDevice {
public:
static VideoCaptureDevice* Create(const Name& device_name);
virtual ~FakeVideoCaptureDevice();
......
......@@ -16,10 +16,11 @@
#include <string>
#include "base/time.h"
#include "media/base/media_export.h"
namespace media {
class VideoCaptureDevice {
class MEDIA_EXPORT VideoCaptureDevice {
public:
struct Name {
......
......@@ -25,7 +25,8 @@ namespace media {
// state from the "main thread" is fundamentally racy. Instead this class keeps
// track of the state every time it is called by the VideoCapture (on the VC
// thread), and forwards that information to the main thread.
class VideoCaptureHandlerProxy : public VideoCapture::EventHandler {
class MEDIA_EXPORT VideoCaptureHandlerProxy
: public VideoCapture::EventHandler {
public:
struct VideoCaptureState {
VideoCaptureState() : started(false), width(0), height(0), frame_rate(0) {}
......
......@@ -17,7 +17,7 @@ struct AVFrame;
namespace media {
class FFmpegVideoDecodeEngine : public VideoDecodeEngine {
class MEDIA_EXPORT FFmpegVideoDecodeEngine : public VideoDecodeEngine {
public:
FFmpegVideoDecodeEngine();
virtual ~FFmpegVideoDecodeEngine();
......
......@@ -6,13 +6,14 @@
#define MEDIA_VIDEO_PICTURE_H_
#include "base/basictypes.h"
#include "media/base/media_export.h"
#include "ui/gfx/size.h"
namespace media {
// A picture buffer that is composed of a GLES2 texture.
// This is the media-namespace equivalent of PP_PictureBuffer_Dev.
class PictureBuffer {
class MEDIA_EXPORT PictureBuffer {
public:
PictureBuffer(int32 id, gfx::Size size, uint32 texture_id);
......@@ -41,7 +42,7 @@ class PictureBuffer {
// A decoded picture frame.
// This is the media-namespace equivalent of PP_Picture_Dev.
class Picture {
class MEDIA_EXPORT Picture {
public:
Picture(int32 picture_buffer_id, int32 bitstream_buffer_id);
......
......@@ -164,7 +164,7 @@ enum VideoColorFormat {
//
// No thread-safety guarantees are implied by the use of RefCountedThreadSafe
// below.
class VideoDecodeAccelerator
class MEDIA_EXPORT VideoDecodeAccelerator
: public base::RefCountedThreadSafe<VideoDecodeAccelerator> {
public:
// Enumeration of potential errors generated by the API.
......
......@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "media/base/media_export.h"
#include "media/base/video_decoder_config.h"
#include "media/base/video_frame.h"
......@@ -30,9 +31,9 @@ struct VideoCodecInfo {
uint32 surface_height;
};
class VideoDecodeEngine {
class MEDIA_EXPORT VideoDecodeEngine {
public:
struct EventHandler {
struct MEDIA_EXPORT EventHandler {
public:
virtual ~EventHandler() {}
virtual void OnInitializeComplete(const VideoCodecInfo& info) = 0;
......
......@@ -106,6 +106,7 @@
'<(DEPTH)/base/base.gyp:base_i18n',
'<(DEPTH)/base/base.gyp:base_static',
'<(DEPTH)/gpu/gpu.gyp:gles2_implementation',
'<(DEPTH)/media/media.gyp:yuv_convert',
'<(DEPTH)/net/net.gyp:net',
'<(DEPTH)/ppapi/ppapi.gyp:ppapi_c',
'<(DEPTH)/ppapi/ppapi_internal.gyp:ppapi_shared',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment