This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <pthread.h> | |
using namespace std; | |
void* thread_method(void* parameter){ | |
string s = *(string*)(parameter); | |
cout<<s<<endl; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=g++ | |
PROGRAM = main | |
OBJECTS = $(PROGRAM).o | |
LIBS = -lpthread | |
CFLAGS = -g -O2 $(LIBS) | |
$(PROGRAM): $(OBJECTS) | |
$(CC) $(CFLAGS) $(OBJECTS) -o $(PROGRAM) | |
run: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <pthread.h> | |
using namespace std; | |
void* thread_method(void* parameter){ | |
string s = *(string*)(parameter); | |
cout<<s<<endl; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <pthread.h> | |
using namespace std; | |
void* thread_method(void* parameter){ | |
string s = *(string*)(parameter); | |
cout<<s<<endl; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Decoder extends Thread { | |
private static final String TAG = Decoder.class.getSimpleName(); | |
private AbstractTrackDecoder audioTrackDecoder; | |
private boolean running = true; | |
public Decoder(String path) { | |
audioTrackDecoder = new AudioTrackDecoder(path); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.ByteBuffer; | |
import android.content.Context; | |
import android.media.AudioFormat; | |
import android.media.AudioManager; | |
import android.media.AudioTrack; | |
import android.media.MediaFormat; | |
import android.net.Uri; | |
class AudioTrackDecoder extends AbstractTrackDecoder { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.view.Surface; | |
class VideoTrackDecoder extends AbstractTrackDecoder { | |
private static final String TAG = VideoTrackDecoder.class.getSimpleName(); | |
private static final String VIDEO_PREFIX = "video/"; | |
public VideoTrackDecoder(String path, Surface surface) { | |
super(path, VIDEO_PREFIX, surface); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.media.api; | |
import android.view.Surface; | |
class VideoTrackDecoder extends AbstractTrackDecoder { | |
private static final String TAG = VideoTrackDecoder.class.getSimpleName(); | |
private static final String VIDEO_PREFIX = "video/"; | |
public VideoTrackDecoder(String path, Surface surface) { | |
super(path, VIDEO_PREFIX, surface); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.media.api; | |
import android.view.Surface; | |
class VideoTrackDecoder extends AbstractTrackDecoder { | |
private static final String TAG = VideoTrackDecoder.class.getSimpleName(); | |
private static final String VIDEO_PREFIX = "video/"; | |
public VideoTrackDecoder(String path, Surface surface) { | |
super(path, VIDEO_PREFIX, surface); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.ByteBuffer; | |
import android.media.MediaCodec; | |
import android.media.MediaExtractor; | |
import android.media.MediaFormat; | |
import android.util.Log; | |
import android.view.Surface; | |
public abstract class AbstractTrackDecoder extends Thread { | |
private static final String TAG = AbstractTrackDecoder.class.getSimpleName(); |