mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Make streamer independent of codec type
Rename VideoStreamer to Streamer, and extract a Codec interface which will also support audio codecs. PR #3757 <https://github.com/Genymobile/scrcpy/pull/3757>
This commit is contained in:
parent
c226797991
commit
10ce0f376a
5 changed files with 39 additions and 11 deletions
|
|
@ -3,7 +3,7 @@ package com.genymobile.scrcpy;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.media.MediaFormat;
|
||||
|
||||
public enum VideoCodec {
|
||||
public enum VideoCodec implements Codec {
|
||||
H264(0x68_32_36_34, "h264", MediaFormat.MIMETYPE_VIDEO_AVC),
|
||||
H265(0x68_32_36_35, "h265", MediaFormat.MIMETYPE_VIDEO_HEVC),
|
||||
@SuppressLint("InlinedApi") // introduced in API 21
|
||||
|
|
@ -19,10 +19,22 @@ public enum VideoCodec {
|
|||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getType() {
|
||||
return Type.VIDEO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMimeType() {
|
||||
return mimeType;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue