gpt4 book ai didi

android - 在 Google-TV Sony 3.2 Android 程序中运行 HLS 流时如何停止(隐身)URL 抑制

转载 作者:行者123 更新时间:2023-11-30 04:11:57 29 4
gpt4 key购买 nike

编辑:根据我在下面的评论,我已经能够将我的测试扩展到其他 Honeycomb 3.2 和 ICS 设备。事实上,在所有情况下,URL 都会出现,因此我可以验证自适应流。因此,这只是 Sony Blueray 的问题(当时它是我唯一的自适应流媒体支持设备)。由于这不是 3.2+ 操作系统的问题,但只有一个制造商设备,所以这不是自适应流测试的问题,我可以撤回此支持请求。

我遇到了 URL 在 locat/DDMS 中被阻止和抑制的问题。我想做的是验证我的 HLS 自适应流是否真的在适应。我打算如何做到这一点是监视 logcat 并观察被拾取的 fragment 。我遇到的问题是 URL 被抑制了,所以我不能看看发生了什么。这是我在 Logcat 中看到的 fragment 。

05-15 14:05:03.499: D/AVAPIMediaPlayer(247): AVAPIMediaPlayer 构造
05-15 14:05:03.503: D/AVAPIMediaPlayer(247): 调用了 initCheck
05-15 14:05:03.503: D/AVAPIMediaPlayer(247): SetDataSource
05-15 14:05:03.503: D/AVAPIMediaPlayer(247): surfaceChangedCallback: 调用 setVideoRectangle 这个 0x66901738, x 480, y 180, w 1440, h 680
05-15 14:05:03.507:D/AVAPIMediaPlayer(247):为 mime 类型视频/mp2t 创建播放器核心
05-15 14:05:03.507:D/AVSettingsBridge(247):准备,句柄:c560b6c8f9,类型:0
05-15 14:05:03.507:I/AVSettingsBridge(247):IAVSettingsBridgeImpl::registerCb, map 大小:0->1
05-15 14:05:03.511: I/LiveSession(247): onConnect
05-15 14:05:03.511:I/NuHTTPDataSource(247):连接到 @0

现在我很快将这些追溯到 chrome 框架和隐身模式。一些框架来源:http://androidxref.com/source/s?defs=kFlagIncognito&project=frameworks .

81     if (!(mFlags & kFlagIncognito)) {
82 LOG_PRI(ANDROID_LOG_INFO, LOG_TAG, "connect to %s @%lld", uri, offset);
83 } else {
84 LOG_PRI(ANDROID_LOG_INFO, LOG_TAG,
85 "connect to <URL suppressed> @%lld", offset);

我还在 Android 3.0 中找到了一个引用,“浏览器包含的新功能可以让用户更有效地导航和组织。多个选项卡取代了浏览器窗口,新的“隐身”模式允许匿名浏览。

我认为它可能默认进入隐身模式?

现在,我不是编码员,只是在努力处理掉在我腿上的代码,但我突然意识到在 setDataSource(Context context, Uri uri) 或相关的 HTTP header 中的某处可能有一个标签/标志可以设置为打开或关闭隐身模式。那些经验丰富的 Android 程序员可能会很快弄明白。

有人能帮忙吗?

如果有帮助,我在下面提供了其他引用资料。


我们代码中的引用:

 public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

Intent receivedIntent = this.getIntent();
receivedIntent = this.getIntent();
String title = receivedIntent.getExtras().getString("label");
String subtitle = receivedIntent.getExtras().getString("subtitle");
String description = receivedIntent.getExtras().getString("description");
String URI = receivedIntent.getExtras().getString("URI");
String imagePrefix = receivedIntent.getExtras().getString("imagePrefix");
setContentView(R.layout.video_page);

String fileName = Environment.getExternalStorageDirectory().toString() + "/CamaroPit/" + imagePrefix + ".mp4";
File file = new File(fileName);
if (!file.exists()) {
fileName = Environment.getExternalStorageDirectory().toString() + "/CamaroPit/alschevrolet.mp4";
}

Log.d("GTV", "Video to play: " + fileName);
TextView textTitle = (TextView) findViewById(R.id.video_page_title);
textTitle.setText(title);
TextView textSubtitle = (TextView) findViewById(R.id.video_page_subtitle);
if (subtitle.equals("subtitle")) {
subtitle = "Check out \""+ title + "\" and really get a feel for your Camaro.";
}
textSubtitle.setText(subtitle);
TextView textDescription = (TextView) findViewById(R.id.video_page_description);
textDescription.setText(description);
this.getWindow().setFormat(PixelFormat.TRANSPARENT);
final VideoView vView = (VideoView) findViewById(R.id.page_view);
vView.setMediaController(new MediaController(this));
vView.setVideoURI(Uri.parse(URI));
vView.requestFocus();
}

item.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
final VideoView vView = (VideoView) GTVHomeScreenSetup.this.homeScreen.findViewById(R.id.gtv_video_view);
MediaController mC = new MediaController(GTVHomeScreenSetup.this.homeScreen);
vView.setMediaController(mC);
mC.setAnchorView(vView);

VideoData clickedVideo = currentVideoList.get(item.position);

vView.setVideoURI(Uri.parse(homeScreen.getVideoURI(clickedVideo, cPath)));
vView.start();

item.requestFocus();
for (ImageItemView item : GTVHomeScreenSetup.this.imageItems) {
item.unSelect();
}
item.select();

来自框架的其他引用:

PS:它不允许我将超链接作为超链接发布。

//HTTPBase.h (http://androidxref.com/source/xref/frameworks/base/media/libstagefright/include/HTTPBase.h)

 28 struct HTTPBase : public DataSource {
29 enum Flags {
30 // Don't log any URLs.
31 kFlagIncognito = 1
32 };

//HTTPLiveSource.h (http://androidxref.com/source/xref/frameworks/base/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h)

        struct NuPlayer::HTTPLiveSource : public NuPlayer::Source {
30 HTTPLiveSource(
31 const char *url,
32 const KeyedVector<String8, String8> *headers,
33 bool uidValid = false,
34 uid_t uid = 0);
35
36 virtual void start();
37
38 virtual status_t feedMoreTSData();
39
40 virtual sp<MetaData> getFormat(bool audio);
41 virtual status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit);
42
43 virtual status_t getDuration(int64_t *durationUs);
44 virtual status_t seekTo(int64_t seekTimeUs);
45 virtual bool isSeekable();
46
47 protected:
48 virtual ~HTTPLiveSource();
51 enum Flags {
52 // Don't log any URLs.
53 kFlagIncognito = 1,
54 };
55
56 AString mURL;
57 KeyedVector<String8, String8> mExtraHeaders;
58 bool mUIDValid;
59 uid_t mUID;
60 uint32_t mFlags;

//HTTPLiveSession.h (http://androidxref.com/source/xref/frameworks/base/media/libstagefright/include/LiveSession.h#36)

 33 struct LiveSession : public AHandler {
34 enum Flags {
35 // Don't log any URLs.
36 kFlagIncognito = 1,
37 };
38 LiveSession(uint32_t flags = 0, bool uidValid = false, uid_t uid = 0);

很棒的播放器 140 隐姓埋名 = 0x8000,

PreviewPlayerBase.h132隐姓埋名=32768,

//PreviewPlayerBase.cpp (http://androidxref.com/source/xref/frameworks/media/libvideoeditor/lvpp/PreviewPlayerBase.cpp)

247 status_t PreviewPlayerBase::setDataSource_l(
248 const char *uri, const KeyedVector<String8, String8> *headers) {
249 reset_l();
250
251 mUri = uri;
252
253 if (headers) {
254 mUriHeaders = *headers;
255
256 ssize_t index = mUriHeaders.indexOfKey(String8("x-hide-urls-from-log"));
257 if (index >= 0) {
258 // Browser is in "incognito" mode, suppress logging URLs.
259
260 // This isn't something that should be passed to the server.
261 mUriHeaders.removeItemsAt(index);
262
263 mFlags |= INCOGNITO;
264 }
265 }
266
267 if (!(mFlags & INCOGNITO)) {
268 LOGI("setDataSource_l('%s')", mUri.string());
269 } else {
270 LOGI("setDataSource_l(URL suppressed)");
271 }
272
273 // The actual work will be done during preparation in the call to
274 // ::finishSetDataSource_l to avoid blocking the calling thread in
275 // setDataSource for any significant time.
276
277 return OK;
278 }
279




30 struct ChromiumHTTPDataSource : public HTTPBase {
31 ChromiumHTTPDataSource(uint32_t flags = 0);
32
33 virtual status_t connect(
34 const char *uri,
35 const KeyedVector<String8, String8> *headers = NULL,
36 off64_t offset = 0);
37
38 virtual void disconnect();
39
40 virtual status_t initCheck() const;
41
42 virtual ssize_t readAt(off64_t offset, void *data, size_t size);
43 virtual status_t getSize(off64_t *size);
44 virtual uint32_t flags();

最佳答案

我们通常使用 M0n0wall .只需下载、刻录 DVD,然后在 2 端口 PC 上从中启动。一个连接到网络,另一个连接到您的 Google TV。然后,您可以随心所欲地限制网络。

关于android - 在 Google-TV Sony 3.2 Android 程序中运行 HLS 流时如何停止(隐身)URL 抑制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10726389/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com