Android Open Source - Media-Pack Game Streaming






From Project

Back to project page Media-Pack.

License

The source code is released under:

Apache License

If you think the Android project Media-Pack listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

//
//               INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 2013-2014 Intel Corporation. All Rights Reserved.
////from   w  ww . j  a  v  a 2 s  . c  om

package com.intel.inde.mp.samples;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TableLayout;
import com.intel.inde.mp.StreamingParameters;

public class GameStreaming extends GameCapturing {

    private TableLayout table;

    @Override
    protected void addItemsToUI() {

        updateUI();

        FrameLayout frameLayout = (FrameLayout) findViewById(R.id.frameLayout);
        frameLayout.setVisibility(View.VISIBLE);

        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        table = (TableLayout) inflater.inflate(R.layout.streaming_params, null);

        frameLayout.addView(table);
        findViewById(R.id.host).requestFocus(Gravity.END);
    }

    ///////////////////////////////////////////////////////////////////////////

    private StreamingParameters prepareStreamingParams() throws Exception {

        StreamingParameters parameters = new StreamingParameters();

        parameters.Host = ((EditText) findViewById(R.id.host)).getText().toString();
        parameters.Port = Integer.parseInt(((EditText) findViewById(R.id.port)).getText().toString());
        parameters.ApplicationName = ((EditText) findViewById(R.id.applicationName)).getText().toString();
        parameters.StreamName = ((EditText) findViewById(R.id.streamName)).getText().toString();

        parameters.isToPublishAudio = false;
        parameters.isToPublishVideo = true;

        return parameters;
    }

    ///////////////////////////////////////////////////////////////////////////

    @Override
    protected void startCapturing() {
        try {
            gameRenderer.startCapturing(prepareStreamingParams());
        } catch (Exception e) {
            showToast("Failed to setup streaming parameters.");
            e.printStackTrace();
        }
    }

    @Override
    protected void updateUI() {
        if (gameRenderer.isCapturingStarted()) {

            captureButton.setText("Stop Streaming");

            if(table != null) {
                table.setVisibility(View.INVISIBLE);
            }
        } else {
            captureButton.setText("Start Streaming");

            if(table != null) {
                table.setVisibility(View.VISIBLE);
            }
        }
    }

    @Override
    protected void playVideo() {

    }
}




Java Source Code List

com.intel.inde.mp.android.graphics.EglUtil.java
com.intel.inde.mp.android.graphics.FrameBuffer.java
com.intel.inde.mp.android.graphics.FullFrameTexture.java
com.intel.inde.mp.android.graphics.ShaderProgram.java
com.intel.inde.mp.android.graphics.VideoEffect.java
com.intel.inde.mp.effects.AudioEffect.java
com.intel.inde.mp.effects.AudioReader.java
com.intel.inde.mp.effects.GrayScaleEffect.java
com.intel.inde.mp.effects.InverseEffect.java
com.intel.inde.mp.effects.JpegSubstituteEffect.java
com.intel.inde.mp.effects.OverlayEffect.java
com.intel.inde.mp.effects.RotateEffect.java
com.intel.inde.mp.effects.SepiaEffect.java
com.intel.inde.mp.effects.SubstituteAudioEffect.java
com.intel.inde.mp.effects.TextOverlayEffect.java
com.intel.inde.mp.samples.ActivityWithTimeline.java
com.intel.inde.mp.samples.CameraCapturerActivity.java
com.intel.inde.mp.samples.CameraStreamerActivity.java
com.intel.inde.mp.samples.ComposerAudioEffectActivity.java
com.intel.inde.mp.samples.ComposerAudioEffectCoreActivity.java
com.intel.inde.mp.samples.ComposerCutActivity.java
com.intel.inde.mp.samples.ComposerCutCoreActivity.java
com.intel.inde.mp.samples.ComposerJoinActivity.java
com.intel.inde.mp.samples.ComposerJoinCoreActivity.java
com.intel.inde.mp.samples.ComposerMediaFileInfoActivity.java
com.intel.inde.mp.samples.ComposerMediaFileInfoCoreActivity.java
com.intel.inde.mp.samples.ComposerTranscodeActivity.java
com.intel.inde.mp.samples.ComposerTranscodeCoreActivity.java
com.intel.inde.mp.samples.ComposerVideoEffectActivity.java
com.intel.inde.mp.samples.ComposerVideoEffectCoreActivity.java
com.intel.inde.mp.samples.DemoListAdapter.java
com.intel.inde.mp.samples.DemoListItem.java
com.intel.inde.mp.samples.ExpandableSamplesListAdapter.java
com.intel.inde.mp.samples.FPSCounter.java
com.intel.inde.mp.samples.Format.java
com.intel.inde.mp.samples.GameCapturing.java
com.intel.inde.mp.samples.GameRenderer.java
com.intel.inde.mp.samples.GameStreaming.java
com.intel.inde.mp.samples.MediaStreamerActivity.java
com.intel.inde.mp.samples.MediaStreamerCoreActivity.java
com.intel.inde.mp.samples.RecognitionActivity.java
com.intel.inde.mp.samples.SamplesMainActivity.java
com.intel.inde.mp.samples.VideoCapture.java
com.intel.inde.mp.samples.VideoPlayerActivity.java
com.intel.inde.mp.samples.VideoStreamPlayerActivity.java
com.intel.inde.mp.samples.controls.CameraCaptureSettingsPopup.java
com.intel.inde.mp.samples.controls.GameGLSurfaceView.java
com.intel.inde.mp.samples.controls.PlaybackToolbar.java
com.intel.inde.mp.samples.controls.PopupMessage.java
com.intel.inde.mp.samples.controls.Popup.java
com.intel.inde.mp.samples.controls.RangeSelector.java
com.intel.inde.mp.samples.controls.TimelineItem.java
com.intel.inde.mp.samples.controls.TranscodeSurfaceView.java
com.intel.inde.mp.samples.controls.VideoPlayer.java