Closed Bug 1003711 Opened 10 years ago Closed 10 years ago

[RTSP] Build Darwin Streaming Server on B2G emulator

Categories

(Firefox OS Graveyard :: RTSP, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.0 S6 (18july)

People

(Reporter: ethan, Assigned: ethan)

References

Details

(Whiteboard: [p=5])

Attachments

(4 files, 1 obsolete file)

The purpose of this bug is to support automated tests for RTSP feature (meta bug 998899).

AFAIK, automated tests that require connectivity to the Internet are not practical due to instability and frequent timeout. Thus we intend to build an RTSP server in the B2G emulator so that we can test RTSP functionality without connecting to a server outside the target.

Darwin Streaming Server (DSS) is an open source server technology that allows us to send streaming media to clients using the industry standard RTP and RTSP protocols. It provides a high level of customizability and runs on a variety of platforms allowing us to manipulate the code to fit our needs.

This bug aims at building DSS on the B2G emulator.
Vicamo had ported DSS into our B2G emulator build system.
I will follow up his previous work.
https://github.com/vicamo/darwin-android
Assignee: nobody → ettseng
Blocks: 998899
Status: NEW → ASSIGNED
*** Work Notes ***
Vicamo's darwin-android repository can be successfully built in B2G emulator-ICS.

The LOCAL_MODULE_TAGS is optional, right now we have to specify the phony target name "all-darwin-targets" defined in darwin-android's Android.mk to build it.

Commands:
$ cd B2G_emulator/external
$ git clone https://github.com/vicamo/darwin-android.git
$ cd ..
$ ./build.sh all-darwin-targets

The libraries and executables are installed in these directories:
out/target/product/generic/system/lib/StreamingServerModules/*
out/target/product/generic/system/bin/*
out/target/product/generic/root/sbin/DarwinStreamingServer
*** Work Notes ***
Darwin Streaming Server can be run successfully (verified on Unagi and Emulator-ICS).

Suppose we already cloned and built DarwinStreamingServer by the commands in comment 2.
Perform the following steps to make DSS work on B2G.

Step 0. Modify two paths in the main configuration file of DSS
$ cd B2G_emulator/out/target/product/generic/system/etc/streaming
Edit "streamingserver.xml":
<PREF NAME="error_logfile_dir">/mnt/sdcard</PREF>
<PREF NAME="movie_folder">/mnt/sdcard</PREF>

Step 1. Remount the /system partition on the device read-write
$ adb remount

Step 2. Push the main executable of DSS
$ cd B2G_emulator/out/target/product/generic/root/sbin
$ adb push DarwinStreamingServer /system/b2g

Step 3. Push the configuration file of DSS
$ adb mkdir /etc/streaming
$ cd B2G_emulator/out/target/product/generic/system/etc/streaming
$ adb push streamingserver.xml /etc/streaming

Step 4. Push a media file to the target
$ cd B2G_emulator/external/darwin-android
$ adb push sample_h264_100kbit.mp4 /mnt/sdcard

Step 5. Start DarwinStreamingServer
$ adb shell /system/b2g/DarwinStreamingServer &

Now the DarwinStreamingServer is running on B2G. We can run the emulator, open the browser and enter the following RTSP link to validate the server works.
rtsp://127.0.0.1/sample_h264_100kbit.mp4
Playing an RTSP media from a DarwinStreamingServer on the target.
Whiteboard: [p=5]
Target Milestone: --- → 2.0 S3 (6june)
No longer blocks: 998899
Depends on: 1011414
Blocks: 998899
Target Milestone: 2.0 S3 (6june) → 2.0 S4 (20june)
Hi Vicamo, can you help to review this?
Attachment #8439057 - Flags: review?(vyang)
Comment on attachment 8439057 [details] [review]
Part 1 - Github pull request for b2g-manifest

Cancel the review because a build error is brought in by darwinstreamingserver repo. Need to fix that first.
Attachment #8439057 - Flags: review?(vyang)
Target Milestone: 2.0 S4 (20june) → 2.0 S5 (4july)
Attachment #8439057 - Flags: review?(vyang)
The result of Try server:
https://tbpl.mozilla.org/?tree=Try&rev=5d6197e67b11
Attachment #8439057 - Flags: review?(vyang) → review+
Attachment #8439057 - Attachment description: Github pull request for b2g-manifest → Part 1 - Github pull request for b2g-manifest
(In reply to Ethan Tseng [:ethan] from comment #8)
> Created attachment 8450864 [details] [review]
> Part 2 - Github pull request for darwinstreamingserver

Need a patch to init.rc and a startup helper script as well.
A shell script to setup the configuration and media files for DarwinStreamingServer.
Attachment #8452184 - Flags: review?(vyang)
Add dss and dss-setup to init.rc.
Attachment #8452197 - Flags: review?(vyang)
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #9)
> (In reply to Ethan Tseng [:ethan] from comment #8)
> > Created attachment 8450864 [details] [review]
> > Part 2 - Github pull request for darwinstreamingserver
> Need a patch to init.rc and a startup helper script as well.

Hi Vicamo,
The startup helper script and a patch to init.rc were attached as PRs.
Could you help to review them as well?
Comment on attachment 8452184 [details] [review]
Part 3 - Github pull request for device_generic_goldfish

A pull request can contain as many git commits as you need. You don't send a pull request for each mutually dependent commit. Please 1) rebase your part 4 commit on to part 3 or amend them into one, 2) force push to your bug-1003711-part4 branch, 3) abandon pull request for part 3 branch.
Attachment #8452184 - Flags: review?(vyang)
Attachment #8452197 - Flags: review?(vyang)
Attachment #8450864 - Flags: review?(vyang) → review+
Attachment #8452184 - Attachment is obsolete: true
Comment on attachment 8452197 [details] [review]
Part 3 - Github pull request for device_generic_goldfish

Vicamo,
Thanks for your advice.
Part 3 and 4 were merged as comment 13 proposed.
Attachment #8452197 - Attachment description: Part 4 - Github pull request for device_generic_goldfish → Part 3 - Github pull request for device_generic_goldfish
Attachment #8452197 - Flags: review?(vyang)
Attachment #8452197 - Flags: review?(vyang) → review+
Target Milestone: 2.0 S5 (4july) → 2.0 S6 (18july)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: