Bug 691234: Part 1/3: Move MediaEngine files and tweak interface; r=roc

--HG--
rename : content/media/MediaEngine.h => content/media/webrtc/MediaEngine.h
rename : content/media/MediaEngineDefault.cpp => content/media/webrtc/MediaEngineDefault.cpp
rename : content/media/MediaEngineDefault.h => content/media/webrtc/MediaEngineDefault.h
This commit is contained in:
Anant Narayanan 2012-06-19 17:29:43 -07:00
parent 5a7819ef71
commit 31deb2aeba
6 changed files with 45 additions and 15 deletions

View File

@ -16,8 +16,6 @@ LIBXUL_LIBRARY = 1
EXPORTS = \
AudioSegment.h \
FileBlockCache.h \
MediaEngine.h \
MediaEngineDefault.h \
MediaResource.h \
MediaSegment.h \
MediaStreamGraph.h \
@ -39,7 +37,6 @@ EXPORTS = \
CPPSRCS = \
AudioSegment.cpp \
FileBlockCache.cpp \
MediaEngineDefault.cpp \
MediaResource.cpp \
MediaStreamGraph.cpp \
nsAudioAvailableEventManager.cpp \
@ -87,6 +84,7 @@ ifdef MOZ_MEDIA_PLUGINS
PARALLEL_DIRS += plugins
endif
PARALLEL_DIRS += webrtc
TEST_DIRS += test
FORCE_STATIC_LIB = 1

View File

@ -0,0 +1,31 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = content
LIBRARY_NAME = gkconwebrtc_s
LIBXUL_LIBRARY = 1
EXPORTS += \
MediaEngine.h \
MediaEngineDefault.h \
$(NULL)
CPPSRCS = \
MediaEngineDefault.cpp \
$(NULL)
FORCE_STATIC_LIB = 1
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES += \
-I$(topsrcdir)/media/webrtc/trunk/src \
$(NULL)

View File

@ -50,7 +50,7 @@ public:
virtual void GetUUID(nsAString&) = 0;
/* This call reserves but does not start the device. */
virtual already_AddRefed<nsDOMMediaStream> Allocate() = 0;
virtual nsresult Allocate() = 0;
/* Release the device back to the system. */
virtual nsresult Deallocate() = 0;

View File

@ -39,15 +39,15 @@ MediaEngineDefaultVideoSource::GetUUID(nsAString& aUUID)
return;
}
already_AddRefed<nsDOMMediaStream>
nsresult
MediaEngineDefaultVideoSource::Allocate()
{
if (mState != kReleased) {
return NULL;
return NS_ERROR_FAILURE;
}
mState = kAllocated;
return nsDOMMediaStream::CreateInputStream();
return NS_OK;
}
nsresult
@ -116,7 +116,6 @@ MediaEngineDefaultVideoSource::Start(SourceMediaStream* aStream, TrackID aID)
mImage->SetData(data);
PR_Free(frame);
// AddTrack takes ownership of segment
VideoSegment *segment = new VideoSegment();
segment->AppendFrame(image.forget(), USECS_PER_S / FPS, gfxIntSize(WIDTH, HEIGHT));
@ -209,14 +208,15 @@ MediaEngineDefaultAudioSource::GetUUID(nsAString& aUUID)
return;
}
already_AddRefed<nsDOMMediaStream>
nsresult
MediaEngineDefaultAudioSource::Allocate()
{
if (mState != kReleased) {
return NULL;
return NS_ERROR_FAILURE;
}
mState = kAllocated;
return nsDOMMediaStream::CreateInputStream();
return NS_OK;
}
nsresult
@ -233,12 +233,12 @@ nsresult
MediaEngineDefaultAudioSource::Start(SourceMediaStream* aStream, TrackID aID)
{
if (mState != kAllocated) {
return NULL;
return NS_ERROR_FAILURE;
}
mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
if (!mTimer) {
return NULL;
return NS_ERROR_FAILURE;
}
mSource = aStream;

View File

@ -45,7 +45,7 @@ public:
virtual void GetUUID(nsAString&);
virtual MediaEngineVideoOptions GetOptions();
virtual already_AddRefed<nsDOMMediaStream> Allocate();
virtual nsresult Allocate();
virtual nsresult Deallocate();
virtual nsresult Start(SourceMediaStream*, TrackID);
@ -75,7 +75,7 @@ public:
virtual void GetName(nsAString&);
virtual void GetUUID(nsAString&);
virtual already_AddRefed<nsDOMMediaStream> Allocate();
virtual nsresult Allocate();
virtual nsresult Deallocate();
virtual nsresult Start(SourceMediaStream*, TrackID);

View File

@ -130,6 +130,7 @@ endif #}
ifdef MOZ_MEDIA
SHARED_LIBRARY_LIBS += \
$(DEPTH)/content/media/$(LIB_PREFIX)gkconmedia_s.$(LIB_SUFFIX) \
$(DEPTH)/content/media/webrtc/$(LIB_PREFIX)gkconwebrtc_s.$(LIB_SUFFIX) \
$(NULL)
endif