How to check SnapDragon 810 supports DASH

What Is DASH?

Dynamic Adaptive Streaming over HTTP (DASH), also known as MPEG-DASH, is an adaptive bitrate streaming technique that enables high quality streaming of media content over the Internet delivered from conventional HTTP web servers. Similar to Apple's HTTP Live Streaming (HLS) solution, MPEG-DASH works by breaking the content into a sequence of small HTTP-based file segments, each segment containing a short interval of playback time of a content that is potentially many hours in duration, such as a movie or the live broadcast of a sports event.(wikipedia

SnapDragon 810 Supports DASH?

We can find the Snapdragon 810 processor specs(link), as described in the table Specifications,SnapDragon 810 supports 4K capture and playback with H.264 (AVC) and H.265 (HEVC) formats and DASH.


How To Check?

Get Qualcomm license and download the source code for SnapDragon 810.Then you can find the source code path:

/external/mm-dash/

and

external/mm-dash/QCMediaPlayer/
check the Android.mk then we know, QCMediaPlayer will be Compiled to qcmediaplayer.jar, and put into system/framework. QCMediaPlayer extends MediaPlayer, so we can write a QCMediaPlayer Demo to check whether Qualcomm's chip support DASH.

The key code is as follows:

import com.qualcomm.qcmedia.*;

public class MainActivity extends Activity  implements OnClickListener{
    Button btnplay, btnstop, btnpause;
    SurfaceView surfaceView;
    QCMediaPlayer mediaPlayer;
    int position;

    public void onCreate(Bundle savedInstanceState) {
        //... ...
        mediaPlayer=new QCMediaPlayer();
        surfaceView=(SurfaceView) this.findViewById(R.id.surfaceView);
        surfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);       
        surfaceView.getHolder().addCallback(new Callback() {        
            @Override
            public void surfaceDestroyed(SurfaceHolder holder) {
            }
            @Override
            public void surfaceCreated(SurfaceHolder holder) {
                if (position>0) {
                    try {
                        play();
                        mediaPlayer.seekTo(position);
                        position=0;                     
                    } catch (Exception e) {
                    }
                }
            }           
            @Override
            public void surfaceChanged(SurfaceHolder holder, int format, int width,
                    int height) {
            }
        });     
    }

    @Override
    public void onClick(View v) {   
        switch (v.getId()) {
        case R.id.btnplay:
            play();
            break;
        case R.id.btnpause:
            if (mediaPlayer.isPlaying()) {
                mediaPlayer.pause();
            }else{
                mediaPlayer.start();
            }
            break;
        case R.id.btnstop:
            if (mediaPlayer.isPlaying()) {
                mediaPlayer.stop();
            }
            break;
        default:
            break;
        }
    }

    private void play() {
        try {
            mediaPlayer.reset();
            mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
            //mpd file path
            mediaPlayer.setDataSource("http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-manifest.mpd");
            mediaPlayer.setDisplay(surfaceView.getHolder());
            mediaPlayer.prepare();
            mediaPlayer.start();        
        } catch (Exception e) {
        }
    }
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <SurfaceView
        android:id="@+id/surfaceView"
        android:layout_width="fill_parent"
        android:layout_height="360px" />

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/btnplay"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Play" />

        <Button
            android:id="@+id/btnpause"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Pause" />

        <Button
            android:id="@+id/btnstop"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Stop" />
    </LinearLayout>

</LinearLayout>
Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
#need add jar supports
LOCAL_JAVA_LIBRARIES := qcmediaplayer

# Only compile source java files in this apk.
LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := DASHDemo

LOCAL_SDK_VERSION := current

include $(BUILD_PACKAGE)

# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))
Remember to add network permission in AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" /> 
Finally, Compiled using mmm and installed the DASHDemo.apk to your SnapDragon 810 device.

Further More?

SONY released Multimedia for Android Library as an open source project to support DASH streaming. It's easy for application to support DASH streaming. More information please clickhere.






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值