add: new united playurl grpc interface (#642)

This commit is contained in:
陈寒彤
2023-03-28 04:08:46 +03:00
committed by GitHub
parent 280f69f7ee
commit 28e8a7cbf0
6 changed files with 2590 additions and 2485 deletions

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
package bilibili.app.playerunite.pgcanymodel;
import "bilibili/pgc/gateway/player/v2/playurl.proto";
message PGCAnyModel {
bilibili.pgc.gateway.player.v2.PlayViewBusinessInfo business = 3;
bilibili.pgc.gateway.player.v2.Event event = 4;
bilibili.pgc.gateway.player.v2.ViewInfo view_info = 5;
bilibili.pgc.gateway.player.v2.PlayAbilityExtConf play_ext_conf = 6;
bilibili.pgc.gateway.player.v2.PlayExtInfo play_ext_info = 7;
}

View File

@@ -0,0 +1,27 @@
syntax = "proto3";
package bilibili.app.playerunite.ugcanymodel;
message ButtonStyle {
string text = 1;
string text_color = 2;
string bg_color = 3;
string jump_link = 4;
}
enum PlayLimitCode {
PLC_UNKNOWN = 0;
PLC_NOTPAYED = 1;
}
message PlayLimit {
PlayLimitCode code = 1;
string message = 2;
string sub_message = 3;
ButtonStyle button = 4;
}
message UGCAnyModel {
PlayLimit play_limit = 1;
}

View File

@@ -0,0 +1,45 @@
syntax = "proto3";
package bilibili.app.playerunite.v1;
import "bilibili/playershared/playershared.proto";
import "google/protobuf/any.proto";
// 统一视频url
service Player {
// 视频地址
rpc PlayViewUnite (PlayViewUniteReq) returns (PlayViewUniteReply);
}
//
message PlayViewUniteReq {
// 请求资源VOD信息
bilibili.playershared.VideoVod vod = 1;
//
string spmid = 2;
//
string from_spmid = 3;
// 补充信息, 如ep_id等
map<string, string> extra_content = 4;
}
//
message PlayViewUniteReply {
// 音视频流信息
bilibili.playershared.VodInfo vod_info = 1;
//
bilibili.playershared.PlayArcConf play_arc_conf = 2;
//
bilibili.playershared.PlayDeviceConf play_device_conf = 3;
//
bilibili.playershared.Event event = 4;
// 使用 pgcanymodel / ugcanymodel 进行proto any转换成对应业务码结构体
google.protobuf.Any supplement = 5;
//
bilibili.playershared.PlayArc play_arc = 6;
//
bilibili.playershared.QnTrialInfo qn_trial_info = 7;
//
bilibili.playershared.History history = 8;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,426 +1,445 @@
syntax = "proto3"; syntax = "proto3";
package bilibili.playershared; package bilibili.playershared;
//
message ArcConf { message ArcConf {
bool is_support = 1; bool is_support = 1;
bool disable = 2; bool disable = 2;
ExtraContent extra_connent = 3; ExtraContent extra_content = 3;
repeated int32 unsupport_scene = 4; repeated int32 unsupport_scene = 4;
} }
// 视频编码 // 按钮组件
enum CodeType { message Button {
NOCODE = 0; // // 按钮文本
CODE264 = 1; // H264 string text = 1;
CODE265 = 2; // H265 // 按钮跳转链接
CODEAV1 = 3; // AV1 string link = 2;
} // 埋点上报相关
map<string, string> report_params = 3;
// 功能类型 }
enum ConfType {
NoType = 0; // 视频编码
FLIPCONF = 1; enum CodeType {
CASTCONF = 2; NOCODE = 0; // 不指定
FEEDBACK = 3; CODE264 = 1; // H264
SUBTITLE = 4; CODE265 = 2; // H265
PLAYBACKRATE = 5; CODEAV1 = 3; // AV1
TIMEUP = 6; }
PLAYBACKMODE = 7;
SCALEMODE = 8; // 功能类型
BACKGROUNDPLAY = 9; enum ConfType {
LIKE = 10; NoType = 0;
DISLIKE = 11; FLIPCONF = 1;
COIN = 12; CASTCONF = 2;
ELEC = 13; FEEDBACK = 3;
SHARE = 14; SUBTITLE = 4;
SCREENSHOT = 15; PLAYBACKRATE = 5;
LOCKSCREEN = 16; TIMEUP = 6;
RECOMMEND = 17; PLAYBACKMODE = 7;
PLAYBACKSPEED = 18; SCALEMODE = 8;
DEFINITION = 19; BACKGROUNDPLAY = 9;
SELECTIONS = 20; LIKE = 10;
NEXT = 21; DISLIKE = 11;
EDITDM = 22; COIN = 12;
SMALLWINDOW = 23; ELEC = 13;
SHAKE = 24; SHARE = 14;
OUTERDM = 25; SCREENSHOT = 15;
INNERDM = 26; LOCKSCREEN = 16;
PANORAMA = 27; RECOMMEND = 17;
DOLBY = 28; PLAYBACKSPEED = 18;
COLORFILTER = 29; DEFINITION = 19;
LOSSLESS = 30; SELECTIONS = 20;
FREYAENTER = 31; NEXT = 21;
FREYAFULLENTER = 32; EDITDM = 22;
SKIPOPED = 33; SMALLWINDOW = 23;
RECORDSCREEN = 34; SHAKE = 24;
DUBBING = 35; OUTERDM = 25;
LISTEN = 36; INNERDM = 26;
} PANORAMA = 27;
DOLBY = 28;
message ConfValue { COLORFILTER = 29;
oneof value { LOSSLESS = 30;
// dash流 FREYAENTER = 31;
int32 switch_val = 1; FREYAFULLENTER = 32;
// 分段流 SKIPOPED = 33;
int32 selected_val = 2; RECORDSCREEN = 34;
} DUBBING = 35;
} LISTEN = 36;
}
message DeviceConf {
ConfValue conf_value = 1; //
} message ConfValue {
oneof value {
// DRM类型 // DASH流
enum DrmTechType { int32 switch_val = 1;
// // 分段流
UNKNOWN_DRM = 0; int32 selected_val = 2;
// }
FAIR_PLAY = 1; }
//
WIDE_VINE = 2; //
// 哔哩哔哩自研DRM message DeviceConf {
BILI_DRM = 3; ConfValue conf_value = 1;
} }
// ? 错误码补充信息 // DRM类型
message ExtraContent { enum DrmTechType {
// //
string disable_reason = 1; UNKNOWN_DRM = 0;
// //
uint64 disable_code = 2; FAIR_PLAY = 1;
} //
WIDE_VINE = 2;
// 播放历史 // 哔哩哔哩自研DRM
message History { BILI_DRM = 3;
// 播放进度 }
uint64 progress = 1;
// // ? 错误码补充信息
string toast = 2; message ExtraContent {
// //
uint64 last_play_cid = 3; string disable_reason = 1;
} //
uint64 disable_code = 2;
message PlayDeviceConf { }
map<int32, DeviceConf> arc_confs = 1;
} // 播放历史
message History {
// 错误码 //
enum PlayErr { HistoryInfo current_video = 1;
NoErr = 0; // //
WithMultiDeviceLoginErr = 1; // 管控类型的错误码 HistoryInfo related_video = 2;
} }
// 方案 message HistoryInfo {
message Scheme { //
enum ActionType { int64 progress = 1;
UNKNOWN = 0; //
SHOW_TOAST = 1; int64 last_play_cid = 2;
} }
ActionType action_type = 1;
string toast = 2; //
} message PlayDeviceConf {
//
// map<int32, DeviceConf> arc_confs = 1;
enum UnsupportScene { }
//
UNKNOWN_SCENE = 0; // 错误码
// enum PlayErr {
PREMIERE = 1; NoErr = 0; //
} WithMultiDeviceLoginErr = 1; // 管控类型的错误码
}
// 视频类型
enum VideoType { // 方案
UNKNOWN = 0; message Scheme {
// 用户生成内容 enum ActionType {
UGC = 1; UNKNOWN = 0;
// 专业生产内容 SHOW_TOAST = 1;
PGC = 2; }
} //
ActionType action_type = 1;
// 视频流信息 //
message Stream { string toast = 2;
// 元数据 }
StreamInfo stream_info = 1;
// 流数据 //
oneof content { enum UnsupportScene {
// dash流 //
DashVideo dash_video = 2; UNKNOWN_SCENE = 0;
// 分段流 //
SegmentVideo segment_video = 3; PREMIERE = 1;
} }
}
// 视频类型
// 视频流信息: 元数据 enum VideoType {
message StreamInfo { UNKNOWN = 0;
// 清晰度 // 用户生成内容
uint32 quality = 1; UGC = 1;
// 格式 // 专业生产内容
string format = 2; PGC = 2;
// 格式描述 }
string description = 3;
// 错误码 // 视频流信息
uint32 err_code = 4; message Stream {
// 不满足条件信息 // 元数据
StreamLimit limit = 5; StreamInfo stream_info = 1;
// 是否需要vip // 流数据
bool need_vip = 6; oneof content {
// 是否需要登录 // dash流
bool need_login = 7; DashVideo dash_video = 2;
// 是否完整 // 分段流
bool intact = 8; SegmentVideo segment_video = 3;
// 是否非全二压 }
bool no_rexcode = 9; }
// 清晰度属性位
int64 attribute = 10; // 视频流信息: 元数据
// 新版格式描述 message StreamInfo {
string new_description = 11; // 清晰度
// 格式文字 uint32 quality = 1;
string display_desc = 12; // 格式
// 新版格式描述备注 string format = 2;
string superscript = 13; // 格式描述
// string description = 3;
bool vip_free = 14; // 错误码
// uint32 err_code = 4;
string subtitle = 15; // 不满足条件信息
// 方案 StreamLimit limit = 5;
Scheme scheme = 16; // 是否需要vip
// 支持drm bool need_vip = 6;
bool support_drm = 17; // 是否需要登录
} bool need_login = 7;
// 是否完整
// Dash条目 bool intact = 8;
message DashItem { // 是否非全二压
// 清晰度 bool no_rexcode = 9;
uint32 id = 1; // 清晰度属性位
// 主线流 int64 attribute = 10;
string base_url = 2; // 新版格式描述
// 备用流 string new_description = 11;
repeated string backup_url = 3; // 格式文字
// 带宽 string display_desc = 12;
uint32 bandwidth = 4; // 新版格式描述备注
// 编码id string superscript = 13;
uint32 codecid = 5; //
// md5 bool vip_free = 14;
string md5 = 6; //
// 大小 string subtitle = 15;
uint64 size = 7; // 方案
// 帧率 Scheme scheme = 16;
string frame_rate = 8; // 支持drm
// DRM密钥 bool support_drm = 17;
string widevine_pssh = 9; }
}
// Dash条目
// 视频流信息: dash流 message DashItem {
message DashVideo { // 清晰度
// 主线流 uint32 id = 1;
string base_url = 1; // 主线流
// 备用流 string base_url = 2;
repeated string backup_url = 2; // 备用流
// 带宽 repeated string backup_url = 3;
uint32 bandwidth = 3; // 带宽
// 编码id uint32 bandwidth = 4;
uint32 codecid = 4; // 编码id
// md5 uint32 codecid = 5;
string md5 = 5; // md5
// 大小 string md5 = 6;
uint64 size = 6; // 大小
// 伴音质量id uint64 size = 7;
uint32 audio_id = 7; // 帧率
// 是否非全二压 string frame_rate = 8;
bool no_rexcode = 8; // DRM密钥
// 帧率 string widevine_pssh = 9;
string frame_rate = 9; }
// 宽
int32 width = 10; // 视频流信息: dash流
// 高 message DashVideo {
int32 height = 11; // 主线流
// DRM密钥 string base_url = 1;
string widevine_pssh = 12; // 备用流
} repeated string backup_url = 2;
// 带宽
// 视频流信息: 分段流 uint32 bandwidth = 3;
message SegmentVideo { // 编码id
repeated ResponseUrl segment = 1; uint32 codecid = 4;
} // md5
string md5 = 5;
// 分段流条目 // 大小
message ResponseUrl { uint64 size = 6;
// 分段序号 // 伴音质量id
uint32 order = 1; uint32 audio_id = 7;
// 分段时长 // 是否非全二压
uint64 length = 2; bool no_rexcode = 8;
// 分段大小 // 帧率
uint64 size = 3; string frame_rate = 9;
// 主线流 //
string url = 4; int32 width = 10;
// 备用流 //
repeated string backup_url = 5; int32 height = 11;
// md5 // DRM密钥
string md5 = 6; string widevine_pssh = 12;
} }
// Dash Response, 未使用 // 视频流信息: 分段流
message ResponseDash { message SegmentVideo {
repeated DashItem video = 1; repeated ResponseUrl segment = 1;
repeated DashItem audio = 2; }
}
// 分段流条目
// 视频流信息: 流媒体元数据: 清晰度不满足条件信息 message ResponseUrl {
message StreamLimit { // 分段序号
// 标题 uint32 order = 1;
string title = 1; // 分段时长
// 跳转地址 uint64 length = 2;
string uri = 2; // 分段大小
// 提示信息 uint64 size = 3;
string msg = 3; // 主线流
} string url = 4;
// 备用流
repeated string backup_url = 5;
// 播放页信息-请求: 音视频VOD // md5
message VideoVod { string md5 = 6;
// 视频aid }
int32 aid = 1;
// 视频cid // Dash Response, 未使用
int32 cid = 2; message ResponseDash {
// 清晰度 repeated DashItem video = 1;
uint64 qn = 3; repeated DashItem audio = 2;
// 视频流版本 }
int32 fnver = 4;
// 视频流格式 // 视频流信息: 流媒体元数据: 清晰度不满足条件信息
int32 fnval = 5; message StreamLimit {
// 下载模式 // 标题
// 0:播放 1:flv下载 2:dash下载 string title = 1;
uint32 download = 6; // 跳转地址
// 流url强制是用域名 string uri = 2;
// 0:允许使用ip 1:使用http 2:使用https // 提示信息
int32 force_host = 7; string msg = 3;
// 是否4K }
bool fourk = 8;
// 视频编码
CodeType prefer_codec_type = 9; // 播放页信息-请求: 音视频VOD
// 响度均衡 message VideoVod {
uint64 voice_balance = 10; // 视频aid
} int32 aid = 1;
// 视频cid
// 播放页信息-响应: VOD音视频信息 int32 cid = 2;
message VodInfo { // 清晰度
// 视频清晰度 uint64 qn = 3;
uint32 quality = 1; // 视频流版本
// 视频格式 int32 fnver = 4;
string format = 2; // 视频流格式
// 视频时长 int32 fnval = 5;
uint64 timelength = 3; // 下载模式
// 视频编码id // 0:播放 1:flv下载 2:dash下载
uint32 video_codecid = 4; uint32 download = 6;
// 视频 // 流url强制是用域名
repeated Stream stream_list = 5; // 0:允许使用ip 1:使用http 2:使用https
// 伴音流 int32 force_host = 7;
repeated DashItem dash_audio = 6; // 是否4K
// 杜比伴音流 bool fourk = 8;
DolbyItem dolby = 7; // 视频编码
// 响度均衡操作信息 CodeType prefer_codec_type = 9;
VolumeInfo volume = 8; // 响度均衡
// HIRES伴音流信息 uint64 voice_balance = 10;
LossLessItem loss_less_item = 9; }
}
// 播放页信息-响应: VOD音视频信息
// 杜比伴音流信息 message VodInfo {
message DolbyItem { // 视频清晰度
// 杜比类型 uint32 quality = 1;
enum Type { // 视频格式
NONE = 0; // NONE string format = 2;
COMMON = 1; // 普通杜比音效 // 视频时长
ATMOS = 2; // 全景杜比音效 uint64 timelength = 3;
} // 视频编码id
// 杜比类型 uint32 video_codecid = 4;
Type type = 1; // 视频流
// 音频流 repeated Stream stream_list = 5;
DashItem audio = 2; // 伴音流
} repeated DashItem dash_audio = 6;
// 杜比伴音流
// HIRES伴音流信息 DolbyItem dolby = 7;
message LossLessItem { // 响度均衡操作信息
// 是否为hires VolumeInfo volume = 8;
bool is_lossless_audio = 1; // HIRES伴音流信息
// 音频流信息 LossLessItem loss_less_item = 9;
DashItem audio = 2; }
// 是否需要大会员
bool need_vip = 3; // 杜比伴音流信息
} message DolbyItem {
// 杜比类型
// 响度均衡操作信息 enum Type {
message VolumeInfo { NONE = 0; // NONE
// Measured integrated loudness 实际综合响度 COMMON = 1; // 普通杜比音效
double measured_i = 1; ATMOS = 2; // 全景杜比音效
// Measured loudness range 实际响度范围 }
double measured_lra = 2; // 杜比类型
// Measured true peak 实际响度真峰值 Type type = 1;
double measured_tp = 3; // 音频流
// Measured threshold 实际响度阈值 repeated DashItem audio = 2;
double measured_threshold = 4; }
// Target offset gain(Gain is applied before the true-peak limiter) 目标增益Offset(增益在真实峰值限制器之前应用)
double target_offset = 5; // HIRES伴音流信息
// Target integrated loudness 目标综合响度 message LossLessItem {
double target_i = 6; // 是否为hires
// Target true peak 目标响度真峰值 bool is_lossless_audio = 1;
double target_tp = 7; // 音频流信息
} DashItem audio = 2;
// 是否需要大会员
// bool need_vip = 3;
message PlayArc { }
VideoType video_type = 1;
uint64 aid = 2; // 响度均衡操作信息
uint64 cid = 3; message VolumeInfo {
DrmTechType drm_tech_type = 4; // Measured integrated loudness 实际综合响度
} double measured_i = 1;
// Measured loudness range 实际响度范围
// 播放页信息-响应: PlayArcConf double measured_lra = 2;
message PlayArcConf { // Measured true peak 实际响度真峰值
map<int32, PlayArc> arc_confs = 1; double measured_tp = 3;
} // Measured threshold 实际响度阈值
double measured_threshold = 4;
// 高画质试看信息: 按钮 // Target offset gain(Gain is applied before the true-peak limiter) 目标增益Offset(增益在真实峰值限制器之前应用)
message QnTrialButton { double target_offset = 5;
string text = 1; // Target integrated loudness 目标综合响度
string link = 2; double target_i = 6;
} // Target true peak 目标响度真峰值
double target_tp = 7;
// 播放页信息-响应: 高画质试看信息 }
message QnTrialInfo {
// 能否试看高画质 //
bool trial_able = 1; message PlayArc {
// //
int32 remaining_times = 2; VideoType video_type = 1;
// //
int32 start = 3; uint64 aid = 2;
// //
int32 time_length = 4; uint64 cid = 3;
// //
QnTrialToast start_toast = 5; DrmTechType drm_tech_type = 4;
// }
QnTrialToast end_toast = 6;
// // 播放页信息-响应: PlayArcConf
QnTrialButton quality_open_tip_btn = 8; message PlayArcConf {
} map<int32, ArcConf> arc_confs = 1;
}
// 高画质试看信息: Toast信息
message QnTrialToast { // 播放页信息-响应: 高画质试看信息
// toast文案 老字段 message QnTrialInfo {
string text = 1; // 能否试看高画质
// toast按钮 bool trial_able = 1;
QnTrialButton button = 2; //
} int32 remaining_times = 2;
//
// 事件 int32 start = 3;
message Event { //
// 震动 int32 time_length = 4;
Shake shake = 1; //
} Toast start_toast = 5;
//
// 震动 Toast end_toast = 6;
message Shake { //
// Button quality_open_tip_btn = 8;
string file = 1; }
}
// Toast信息
message Toast {
// toast文案
string text = 1;
// toast按钮
Button button = 2;
}
// 事件
message Event {
// 震动
Shake shake = 1;
}
// 震动
message Shake {
//
string file = 1;
}

File diff suppressed because it is too large Load Diff