-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
775 additions
and
128 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
18 changes: 18 additions & 0 deletions
18
screencapture/src/main/java/com/hd/screencapture/callback/RecorderCallback.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.hd.screencapture.callback; | ||
|
||
import android.media.MediaCodec; | ||
import android.media.MediaFormat; | ||
|
||
/** | ||
* Created by hd on 2018/5/20 . | ||
*/ | ||
public interface RecorderCallback { | ||
|
||
void onInputBufferAvailable(int index); | ||
|
||
void onOutputFormatChanged(MediaFormat format); | ||
|
||
void onOutputBufferAvailable(int index, MediaCodec.BufferInfo info); | ||
|
||
void onError(Exception exception); | ||
} |
15 changes: 15 additions & 0 deletions
15
screencapture/src/main/java/com/hd/screencapture/callback/ScreenCaptureStreamCallback.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.hd.screencapture.callback; | ||
|
||
import android.support.annotation.NonNull; | ||
|
||
/** | ||
* Created by hd on 2018/5/21 . | ||
*/ | ||
public interface ScreenCaptureStreamCallback extends ScreenCaptureCallback { | ||
|
||
void videoHeaderByte(@NonNull byte[] sps,@NonNull byte[] pps); | ||
|
||
void videoContentByte(@NonNull byte[] content); | ||
|
||
void audioContentByte(@NonNull byte[] content); | ||
} |
41 changes: 41 additions & 0 deletions
41
screencapture/src/main/java/com/hd/screencapture/capture/AudioRecorder.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,48 @@ | ||
package com.hd.screencapture.capture; | ||
|
||
import android.annotation.TargetApi; | ||
import android.os.Build; | ||
import android.support.annotation.NonNull; | ||
|
||
import com.hd.screencapture.callback.RecorderCallback; | ||
import com.hd.screencapture.config.ScreenCaptureConfig; | ||
import com.hd.screencapture.observer.CaptureObserver; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
/** | ||
* Created by hd on 2018/5/20 . | ||
*/ | ||
@TargetApi(Build.VERSION_CODES.LOLLIPOP) | ||
public class AudioRecorder extends Recorder { | ||
|
||
public AudioRecorder(@NonNull CaptureObserver observer, @NonNull ScreenCaptureConfig config,// | ||
@NonNull RecorderCallback callback) { | ||
super(observer, config, callback); | ||
} | ||
|
||
@Override | ||
public boolean prepare() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean record() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void release() { | ||
|
||
} | ||
|
||
public void releaseOutputBuffer(int index) { | ||
} | ||
|
||
|
||
public ByteBuffer getOutputBuffer(int index) { | ||
// return mEncoder.getOutputBuffer(index); | ||
return null; | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
screencapture/src/main/java/com/hd/screencapture/capture/Recorder.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,36 @@ | ||
package com.hd.screencapture.capture; | ||
|
||
import android.annotation.TargetApi; | ||
import android.os.Build; | ||
import android.support.annotation.NonNull; | ||
|
||
import com.hd.screencapture.callback.RecorderCallback; | ||
import com.hd.screencapture.config.ScreenCaptureConfig; | ||
import com.hd.screencapture.observer.CaptureObserver; | ||
|
||
/** | ||
* Created by hd on 2018/5/20 . | ||
*/ | ||
@TargetApi(Build.VERSION_CODES.LOLLIPOP) | ||
public abstract class Recorder { | ||
|
||
CaptureObserver observer; | ||
|
||
ScreenCaptureConfig config; | ||
|
||
RecorderCallback callback; | ||
|
||
Recorder(@NonNull CaptureObserver observer,@NonNull ScreenCaptureConfig config,// | ||
@NonNull RecorderCallback callback) { | ||
this.observer = observer; | ||
this.config = config; | ||
this.callback=callback; | ||
} | ||
|
||
public abstract boolean prepare(); | ||
|
||
public abstract boolean record(); | ||
|
||
public abstract void release(); | ||
|
||
} |
Oops, something went wrong.