我尝试了如OpenGL ES2 for Android中所示的程序,但它不能正常工作!
我在Odroid E,三星s3,三星y,三星之星测试过!!
the gl version suported returns 2, but i get
11-22 15:09:45.804: E/oGl-es v(9047): 2.0:131072
11-22 15:09:45.804: E/libEGL(9047): call to OpenGL ES API with no current context (logged once per thread)
11-22 15:09:45.804: E/unable to(9047): createShader
11-22 15:09:45.804: E/libEGL(9047): call to OpenGL ES API with no current context (logged once per thread)
11-22 15:09:45.804: E/unable to(9047): createShader
11-22 15:09:45.804: E/libEGL(9047): call to OpenGL ES API with no current context (logged once per thread)
11-22 15:09:45.804: …
Run Code Online (Sandbox Code Playgroud) 我正在使用asyncTasks,用图像加载列表元素(只需按照android的有效加载位图的教程)
在DDMS中,我可以看到最多5个AsyncTasks正在运行
此外,我还添加了另一个AsyncTask,它使用MediaCodec类执行一些解码.
现在在DDMS中,我仍然看到5个AsyncTasks,我的图像加载aynctask或解码异步任务执行,而不是两个.
当解码正在运行时,如果我滚动列表,元素的图像不会更新当我通过调用它的执行方法启动新的解码asynctask时,解码不会启动,但如果我现在滚动列表视图,图像会更新.
那么AsyncTask是否有限制?
即使在listAdapter中,我也会根据getView调用启动AsyncTask.我期待7个运行asyncTasks(如果列表可见元素是7,比方说),但DDMS只显示5个asynctasks正在运行.
现在有人可以解释一下我无法拼写的黑魔法是什么吗?
android executorservice android-asynctask threadpoolexecutor
我有一个徽标视图,这是一个包含单个的全屏片段ImageView
.在徽标图像完全可见后,我必须执行一些操作.
以下代码用于调用特殊任务
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ImageView logoImageMaster = new ImageView(getContext());
//logoImageMaster.setImageResource(resID); //even after removing this, i am getting the callback twice
try {
// get input stream
InputStream ims = getActivity().getAssets().open("product_logo.png");
// load image as Drawable
Drawable d = Drawable.createFromStream(ims, null);
// set image to ImageView
logoImageMaster.setImageDrawable(d);
}
catch(IOException ex) {
}
logoImageMaster.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() { //FIXME get called twice. Check this out, no info to distinguish …
Run Code Online (Sandbox Code Playgroud) 在Android 4.4.2中,我MediaCodec
用来解码mp3
文件.我正在使用queueInputBuffer()
输入mp3编码帧排队并dequeueOutputBuffer()
获得解码帧.但是解码器从第8帧开始提供解码输出(基于bufferInfo.presentationTimeUs
)并跳过最初的7帧.此方案仅针对少数流而不针对所有流发生.此外,这种行为在许多运行中都是一致的.
我想要所有帧的解码输出,我不希望任何帧被跳过.任何人都可以帮助我理解为什么帧被跳过?我保证流不会被破坏.因为我要INFO_TRY_AGAIN
到第7帧,当`dequeueOutputBuffer'返回有效的缓冲区索引时,它的呈现时间总是第8帧.
以下是排队代码:
Log.e(TAG, "audptOffset = "+audptOffset+"input PT = "+audpt);
audcodec.queueInputBuffer(audInbufIndex, 0, audchunkSize, audpt, 0);
Run Code Online (Sandbox Code Playgroud)
以下是我如何调用dequeue并写入AudioTrack:
if(!audoutputDone ){
if(!waitForAudioRelease){
auoutBufIndex = audcodec.dequeueOutputBuffer(auinfo, 100);
Log.e(TAG, "Output PT = " + auinfo.presentationTimeUs+"auoutBufIndex = "+auoutBufIndex);
}
if (auoutBufIndex >= 0) {
waitForAudioRelease = true;
} else if (auoutBufIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
auddecOutBufArray = audcodec.getOutputBuffers();
} else if (auoutBufIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
MediaFormat newFormat = audcodec.getOutputFormat();
int sampleRate1 = newFormat.getInteger(MediaFormat.KEY_SAMPLE_RATE);
int …
Run Code Online (Sandbox Code Playgroud) 编辑反映matias's
评论
实际上,最初我没有supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
或requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
在我的代码中,直到我注意到runtime exception when below combinations of actions happened
用户按下主页按钮以最小化应用程序并尝试从最近的应用程序(长按主页按钮)恢复它
当屏幕旋转发生时(注意:清单没有 configChange声明)
然后我认为在初始化期间显示不确定的进度条应该导致问题,所以只有我尝试调用request*
方法,认为它会清除它,但没有发生任何事情..
最后我
showPdIndeterminate();
为了测试而删除了.因此,在我的代码中我无处可见.在上述情况下仍然发生同样的情况
我有一个片段ActionBarActivity
,我的布局包裹在里面DrawerLayout
,two framelayouts
以容纳两个frgaments.
我尝试在super.onCreate上添加内容错误之前必须调用requestFeature(),但仍然是相同的异常
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.e(TAG, "Inside OnCreate");
// supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
showPdIndeterminate();
....
}
Run Code Online (Sandbox Code Playgroud)
并且showPdIndeterminate()
是
private void showPdIndeterminate() {
pd = ProgressDialog.show(this, "Initializing", "Pls wait...");
pd.setIndeterminate(true);
pd.show();
}
Run Code Online (Sandbox Code Playgroud)
NullPointerException
如果我尝试supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); …
在代码中,我有以下声明
#if GCC == 1
#define SET_STACK(s) asm("movl temp,%esp");
...
#endif
Run Code Online (Sandbox Code Playgroud)
在代码中,恰好在一个地方,使用这个宏,编译器在哪个行上指示undefined reference to 'temp'
.
temp = (int*)some_pointer;
SET_STACK(temp);
Run Code Online (Sandbox Code Playgroud)
该temp
变量声明为全球挥发性空指针
volatile void* temp;
Run Code Online (Sandbox Code Playgroud)
内联汇编有什么语法问题吗?根据我的理解,内联汇编尝试加载temp
(不是取消引用的值,而是指针本身)的值
我正在尝试从libavcodec
和构建一些文件libavutil
在此之后,我创建了Android.mk文件,如下所示:
jni/Android.mk
包含
LOCAL_PATH := $(call my-dir)
FFMPEG_TOP := $(LOCAL_PATH)
include $(CLEAR_VARS)
include $(FFMPEG_TOP)/libavutil/Android.mk
include $(FFMPEG_TOP)/libavcodec/Android.mk
LOCAL_PATH := $(FFMPEG_TOP)
LOCAL_MODULE := mylib
LOCAL_ARM_MODE := arm # remove this if you want thumb mode
LOCAL_SRC_FILES := myfunc1.c myfunc2.c maincfunction.c 3rdparty1.c 3rdparty2.c
LOCAL_SRC_FILES += libavcodec.a libavutil.a
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
Run Code Online (Sandbox Code Playgroud)
jni/libavcodec/Android.mk
包含
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
SOURCE_H264_DECODER += h264.c h264idct.c h264pred.c h264_parser.c cabac.c
SOURCE_H264_ENCODER += h264enc.c h264dspenc.c
SOURCE_HAVE_ARM = \
arm/dsputil_arm.c \
arm/dsputil_arm_s.S \ …
Run Code Online (Sandbox Code Playgroud) BSP支持Hw加速编解码器的隧道传输.Android用于feature-tunneled-playback
检查是否支持隧道.如果是,它将尝试配置隧道.如何实现或指定android扩展OMX.google.android.index.configureVideoTunnelMode
它只是说对于隧道播放支持,应该支持扩展.如何公开这个扩展,以便android将支持隧道?
在automake的Makefile.am中,程序的源代码如下所示:
bin_PROGRAMS = os345v1
os345v1_SOURCES = os345.c os345interrupts.c os345semaphores.c
而不是指定单个文件,而是如何在特定目录和子目录中添加所有c文件?
以下是一个简单的正弦波图形显示.我想使用捏缩放手势放大和缩小.
data = new GraphViewData[num];
double v=0;
for (int i=0; i<num; i++) {
v = 2*Math.PI*30*i;
data[i] = new GraphViewData(i, Math.sin(v/num));
}
graphView = new LineGraphView(this, "GraphViewDemo");
// add data
graphView.addSeries(new GraphViewSeries(data));
// set view port, here num = 256
graphView.setViewPort(0, num-1);
graphView.setScrollable(true);
LinearLayout layout = (LinearLayout) findViewById(R.id.graph1);
layout.addView(graphView);
Run Code Online (Sandbox Code Playgroud)
是否有任何属性可以启用缩放功能,或者我应该手动实现setViewPort()并处理缩放功能?
android ×8
mediacodec ×2
android-view ×1
android.mk ×1
audiotrack ×1
autoconf ×1
automake ×1
c ×1
cygwin ×1
egl ×1
ffmpeg ×1
opengl-es ×1
openmax ×1
pointers ×1
x86 ×1