Open
Bug 848189
Opened 12 years ago
Updated 2 years ago
Fake Video Implementation for WebRTC Tests
Categories
(Core :: WebRTC: Audio/Video, defect, P3)
Tracking
()
REOPENED
backlog | webrtc/webaudio+ |
People
(Reporter: snandaku, Unassigned)
Details
Attachments
(3 files, 1 obsolete file)
5.73 KB,
patch
|
jesup
:
review+
ehugg
:
review+
|
Details | Diff | Splinter Review |
8.35 KB,
patch
|
jesup
:
review+
ehugg
:
review+
|
Details | Diff | Splinter Review |
10.83 KB,
patch
|
jesup
:
review+
ehugg
:
review+
|
Details | Diff | Splinter Review |
WebRTC Unit tests and echo-server project needs Fake Video implementation.
Comment on attachment 721574 [details]
Fake Video Implementation for WebRTC Tests
Patch that does fake video verification for signaling unit tests. Have tested it on OSX locally. Will verify it on Linux tomorrow morning.
Attachment #721574 -
Flags: review?(rjesup)
Attachment #721574 -
Flags: review?(ethanhugg)
Attachment #721574 -
Flags: review?(ekr)
Comment 3•12 years ago
|
||
Comment on attachment 721574 [details]
Fake Video Implementation for WebRTC Tests
Review of attachment 721574 [details]:
-----------------------------------------------------------------
Waiting on r+/- until the SYNC issue is answered
::: media/webrtc/signaling/test/signaling_unittests.cpp
@@ +649,5 @@
> + Fake_AudioStreamSource *audio_stream =
> + new Fake_AudioStreamSource();
> + test_utils->sts_target()->Dispatch(
> + WrapRunnableRet(audio_stream, &Fake_MediaStream::Start, &ret),
> + NS_DISPATCH_SYNC);
Do these need to be DISPATCH_SYNC?
Can ::Start() in Fake_MediaStrema actually fail in any reasonable fashion? And if so, is it important that that be noticed here - can we just fail the test in ::Start()?
That said, I'm not certain the restrictions against DISPATCH_SYNC are really relevant in the unit tests today - but if we can move them to the "real" mainthread, perhaps they will be (haven't thought closely about it).
@@ +663,5 @@
> +
> + test_utils->sts_target()->Dispatch(
> + WrapRunnableRet(video_stream, &Fake_MediaStream::Start, &ret),
> + NS_DISPATCH_SYNC);
> + ASSERT_TRUE(NS_SUCCEEDED(ret));
ditto
Comment on attachment 721574 [details]
Fake Video Implementation for WebRTC Tests
Review of attachment 721574 [details]:
-----------------------------------------------------------------
::: media/webrtc/signaling/test/signaling_unittests.cpp
@@ +649,5 @@
> + Fake_AudioStreamSource *audio_stream =
> + new Fake_AudioStreamSource();
> + test_utils->sts_target()->Dispatch(
> + WrapRunnableRet(audio_stream, &Fake_MediaStream::Start, &ret),
> + NS_DISPATCH_SYNC);
Since this is the way the unittests are run today, should we go with DISPATCH_SYNC for now and open a new bug to fix it once the current DISPATHC_SYNC issue is resolved.
Comment 5•12 years ago
|
||
Comment on attachment 721574 [details]
Fake Video Implementation for WebRTC Tests
Review of attachment 721574 [details]:
-----------------------------------------------------------------
::: media/webrtc/signaling/test/FakeMediaStreams.h
@@ +140,5 @@
> + mozilla::TrackTicks aDuration,
> + const Fake_gfxIntSize& aIntrinsicSize);
> +
> + const Fake_VideoFrame* GetFrameAt(mozilla::TrackTicks aOffset,
> + mozilla::TrackTicks* aStart = nullptr)
indentation - check you don't have tabs; I see this in heavily-indented function devs in this
::: media/webrtc/signaling/test/FakeMediaStreamsImpl.h
@@ +101,5 @@
> }
>
>
> +// Fake_VideoFrame
> +Fake_VideoFrame::Fake_VideoFrame(already_AddRefed<Fake_Image> aImage,const Fake_gfxIntSize& aIntrinsicSize)
space after comma (throughout)
@@ +105,5 @@
> +Fake_VideoFrame::Fake_VideoFrame(already_AddRefed<Fake_Image> aImage,const Fake_gfxIntSize& aIntrinsicSize)
> + :mImage(aImage),mIntrinsicSize(aIntrinsicSize) {}
> +
> +
> +Fake_VideoFrame::Fake_VideoFrame():mIntrinsicSize(0, 0) {}
spaces around ':'
@@ +157,5 @@
> + return;
> + }
> +
> + nsRefPtr<Fake_Image> image = new Fake_Image();
> + memset(image->mData.get(),IMAGE_COLOR,image->YUVSize());
You may want to check the current "video:true fake:true" generation that does a slow color shift so you can see if things are alive.
@@ +167,5 @@
> + segment.AppendFrame(image.forget(), 0, Fake_gfxIntSize(width,height));
> +
> + for(std::set<Fake_MediaStreamListener *>::iterator it = mListeners.begin();
> + it != mListeners.end(); ++it) {
> + (*it)->NotifyQueuedTrackChanges(NULL, // Graph
NULL for graph could cause real problems, but current users appear to not use it. At least comment that if anyone starts using it, at least a dumb impl of the interface will be required.
@@ +169,5 @@
> + for(std::set<Fake_MediaStreamListener *>::iterator it = mListeners.begin();
> + it != mListeners.end(); ++it) {
> + (*it)->NotifyQueuedTrackChanges(NULL, // Graph
> + 0, // TrackID
> + 90000, // Rate (hz)
USECS_PER_S (1000000)
::: media/webrtc/signaling/test/signaling_unittests.cpp
@@ +659,4 @@
> if (offerFlags & OFFER_VIDEO) {
> aHintContents |= DOMMediaStream::HINT_CONTENTS_VIDEO;
> + Fake_VideoStreamSource *video_stream =
> + new Fake_VideoStreamSource();
one line
Attachment #721574 -
Flags: review?(rjesup) → review+
Updated•12 years ago
|
Whiteboard: [WebRTC][blocking-webrtc-]
Comment on attachment 721574 [details]
Fake Video Implementation for WebRTC Tests
MediaPipeline, Thread Dispatch code has changed a lot since this patch was reviewed. Hence making this patch obsolete and uploading new ones.
Attachment #721574 -
Attachment is obsolete: true
Attachment #721574 -
Attachment is patch: false
Attachment #721574 -
Flags: review?(ethanhugg)
Attachment #721574 -
Flags: review?(ekr)
Signaling Video call test to verify FakeVideo changes after Dispatch Sync landed.
Attachment #731603 -
Flags: review?(rjesup)
Attachment #731603 -
Flags: review?(ethanhugg)
Attachment #731603 -
Flags: review?(ekr)
MediaPipeline with FakeVideo support with changes from DispatchSync bug landed.
Attachment #731604 -
Flags: review?(rjesup)
Attachment #731604 -
Flags: review?(ethanhugg)
Attachment #731604 -
Flags: review?(ekr)
FakeVideo Implementation
Attachment #731605 -
Flags: review?(rjesup)
Attachment #731605 -
Flags: review?(ethanhugg)
Attachment #731605 -
Flags: review?(ekr)
Reporter | ||
Comment 10•12 years ago
|
||
Taking r+ from Randell forward.
These new patches are breakup of a one large patch for FakeVideo support and these are updated to reflect changes from Disptach sync family of updates.
Comment 11•12 years ago
|
||
Comment on attachment 731605 [details] [diff] [review]
Part1 FakeMediaStreams* to support Fake_Video
Review of attachment 731605 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with comments addressed.
::: media/webrtc/signaling/test/FakeMediaStreams.h
@@ +70,5 @@
> + return height;
> + }
> +
> + int width;
> + int height;
I would expect these to be mWidth or width_ and probably be private as well since there are accessor methods above
@@ +88,5 @@
> + return (mImage == aFrame.mImage);
> + }
> +
> + bool operator!=(const Fake_VideoFrame& aFrame) const {
> + return !operator==(aFrame);
Is this where you intended to put the parens on this line?
Attachment #731605 -
Flags: review?(ethanhugg) → review+
Updated•12 years ago
|
Attachment #731604 -
Flags: review?(ethanhugg) → review+
Comment 12•12 years ago
|
||
Comment on attachment 731603 [details] [diff] [review]
Part3 Enable VideoCall tests in signalingtests
Review of attachment 731603 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with comment addressed.
::: media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ +923,1 @@
> source->AsSourceStream()->AddTrack(track_id, track_rate, 0, segment);
So, my current source already has the AddListener line and I don't understand this comment. Which is the 'below change'?
Attachment #731603 -
Flags: review?(ethanhugg) → review+
Reporter | ||
Comment 13•12 years ago
|
||
(In reply to Ethan Hugg [:ehugg] from comment #12)
> Comment on attachment 731603 [details] [diff] [review]
> Part3 Enable VideoCall tests in signalingtests
>
> Review of attachment 731603 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> r+ with comment addressed.
>
> ::: media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
> @@ +923,1 @@
> > source->AsSourceStream()->AddTrack(track_id, track_rate, 0, segment);
>
> So, my current source already has the AddListener line and I don't
> understand this comment. Which is the 'below change'?
Adding listener didn't reflect in the latest version of m-c when i uploaded this patch. The plan is to remove that line from this patch before committing.
Reporter | ||
Comment 14•12 years ago
|
||
(In reply to Ethan Hugg [:ehugg] from comment #11)
> Comment on attachment 731605 [details] [diff] [review]
> Part1 FakeMediaStreams* to support Fake_Video
>
> Review of attachment 731605 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> r+ with comments addressed.
>
> ::: media/webrtc/signaling/test/FakeMediaStreams.h
> @@ +70,5 @@
> > + return height;
> > + }
> > +
> > + int width;
> > + int height;
>
> I would expect these to be mWidth or width_ and probably be private as well
> since there are accessor methods above
>
> @@ +88,5 @@
> > + return (mImage == aFrame.mImage);
> > + }
> > +
> > + bool operator!=(const Fake_VideoFrame& aFrame) const {
> > + return !operator==(aFrame);
>
> Is this where you intended to put the parens on this line?
it was supposed to be negation of operator==(). Am i missing something here ..
Comment 15•12 years ago
|
||
Comment on attachment 731605 [details] [diff] [review]
Part1 FakeMediaStreams* to support Fake_Video
Review of attachment 731605 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/webrtc/signaling/test/FakeMediaStreams.h
@@ +50,5 @@
> +class Fake_Image {
> + public:
> + Fake_Image(): width(640),
> + height(480),
> + mData(new uint8_t[(width*height)* 3/2]) {}
Use YUVSize()
@@ +72,5 @@
> +
> + int width;
> + int height;
> + nsAutoPtr<uint8_t> mData;
> + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Fake_Image);
Normal style is to put DECL macros at/near the top
@@ +88,5 @@
> + return (mImage == aFrame.mImage);
> + }
> +
> + bool operator!=(const Fake_VideoFrame& aFrame) const {
> + return !operator==(aFrame);
Parens for clarity
@@ +109,5 @@
> +
> + void SliceTo(mozilla::TrackTicks aStart, mozilla::TrackTicks aEnd)
> + {
> + NS_ASSERTION(aStart >= 0 && aStart < aEnd && aEnd <= mDuration,
> + "Slice out of bounds");
MOZ_ASSERT please
@@ +281,5 @@
> + while(!iter.IsEnded()) {
> + Fake_VideoChunk& chunk = *(iter);
> + Fake_Image *img = chunk.mFrame.GetImage();
> + if(!img)
> + {
brace style
@@ +286,5 @@
> + return true;
> + }
> + uint8_t* buf = img->mData.get();
> + //TODO: remove hard-coding
> + int size = ((640*480) * 3 / 2);
If hard-coded, use #defines for width/height (and share with code that creates the images).
Use YUVSize()
@@ +431,5 @@
> + }
> +
> + virtual void Periodic();
> + bool mStop;
> + nsRefPtr<Fake_Image> mSourceImage;
Should these be private? (Not a big deal)
Attachment #731605 -
Flags: review?(rjesup) → review+
Comment 16•12 years ago
|
||
Comment on attachment 731604 [details] [diff] [review]
Part2 MediaPipeline updates to support Fake_Video
Review of attachment 731604 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ +824,5 @@
> +#endif
> +#ifdef USE_FAKE_MEDIA_STREAMS
> + uint32_t width = img->Width();
> + uint32_t height = img->Height();
> + int length = ((width * height) * 3 / 2);
Can we use YUVSize() here?
Attachment #731604 -
Flags: review?(rjesup) → review+
Comment 17•12 years ago
|
||
Comment on attachment 731603 [details] [diff] [review]
Part3 Enable VideoCall tests in signalingtests
Review of attachment 731603 [details] [diff] [review]:
-----------------------------------------------------------------
r+ modulo answering ehugg's question
Attachment #731603 -
Flags: review?(rjesup) → review+
Reporter | ||
Comment 18•12 years ago
|
||
Comment on attachment 731603 [details] [diff] [review]
Part3 Enable VideoCall tests in signalingtests
Review of attachment 731603 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ +923,1 @@
> source->AsSourceStream()->AddTrack(track_id, track_rate, 0, segment);
since this patch was written before the above line was added to the MediaPipeline code. The comment meant to remove this line in the final patch.
Reporter | ||
Comment 19•12 years ago
|
||
Comment on attachment 731604 [details] [diff] [review]
Part2 MediaPipeline updates to support Fake_Video
Review of attachment 731604 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ +824,5 @@
> +#endif
> +#ifdef USE_FAKE_MEDIA_STREAMS
> + uint32_t width = img->Width();
> + uint32_t height = img->Height();
> + int length = ((width * height) * 3 / 2);
Sure Randell .. I will investigate this.
Reporter | ||
Comment 20•12 years ago
|
||
Comment on attachment 731605 [details] [diff] [review]
Part1 FakeMediaStreams* to support Fake_Video
Review of attachment 731605 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/webrtc/signaling/test/FakeMediaStreams.h
@@ +70,5 @@
> + return height;
> + }
> +
> + int width;
> + int height;
Sure Ethan .. will do
@@ +72,5 @@
> +
> + int width;
> + int height;
> + nsAutoPtr<uint8_t> mData;
> + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Fake_Image);
I will update it as suggested
@@ +88,5 @@
> + return (mImage == aFrame.mImage);
> + }
> +
> + bool operator!=(const Fake_VideoFrame& aFrame) const {
> + return !operator==(aFrame);
I will do so
@@ +109,5 @@
> +
> + void SliceTo(mozilla::TrackTicks aStart, mozilla::TrackTicks aEnd)
> + {
> + NS_ASSERTION(aStart >= 0 && aStart < aEnd && aEnd <= mDuration,
> + "Slice out of bounds");
Agreed .. Will update it
@@ +281,5 @@
> + while(!iter.IsEnded()) {
> + Fake_VideoChunk& chunk = *(iter);
> + Fake_Image *img = chunk.mFrame.GetImage();
> + if(!img)
> + {
Will change
@@ +286,5 @@
> + return true;
> + }
> + uint8_t* buf = img->mData.get();
> + //TODO: remove hard-coding
> + int size = ((640*480) * 3 / 2);
Sure
@@ +431,5 @@
> + }
> +
> + virtual void Periodic();
> + bool mStop;
> + nsRefPtr<Fake_Image> mSourceImage;
Will make them so
Comment 21•10 years ago
|
||
Comment on attachment 731605 [details] [diff] [review]
Part1 FakeMediaStreams* to support Fake_Video
Review of attachment 731605 [details] [diff] [review]:
-----------------------------------------------------------------
Is this still relevant? If so, please r? again.
Attachment #731605 -
Flags: review?(ekr)
Comment 22•10 years ago
|
||
Comment on attachment 731604 [details] [diff] [review]
Part2 MediaPipeline updates to support Fake_Video
Review of attachment 731604 [details] [diff] [review]:
-----------------------------------------------------------------
Is this still relevant? If so, please r? again.
Attachment #731604 -
Flags: review?(ekr)
Comment 23•10 years ago
|
||
Comment on attachment 731603 [details] [diff] [review]
Part3 Enable VideoCall tests in signalingtests
Review of attachment 731603 [details] [diff] [review]:
-----------------------------------------------------------------
Is this still relevant? If so, please r? again.
Attachment #731603 -
Flags: review?(ekr)
Updated•10 years ago
|
backlog: --- → webRTC+
Rank: 25
Whiteboard: [WebRTC][blocking-webrtc-]
Comment 24•9 years ago
|
||
I'm going to assume this is no longer relevant at this point given the age of the patches.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Comment 25•9 years ago
|
||
(In reply to Dan Minor [:dminor] from comment #24)
> I'm going to assume this is no longer relevant at this point given the age
> of the patches.
The patches may be pretty dusty/rotted, but last I checked we didn't have real video support in the unit tests. See all the "if !defined(MOZILLA_EXTERNAL_LINKAGE)" lines in MediaPipeline, for example. So the bug/ask to include video in unit tests is still there.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Comment 26•8 years ago
|
||
We'll need to fix this as part of Bug 1319489.
Comment 27•8 years ago
|
||
As it turns out, Bug 1319489 only needs a fake audio implementation.
No longer blocks: 1319489
Comment 28•7 years ago
|
||
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3
Updated•3 years ago
|
Assignee: snandaku → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•