eneim / toro

Video list auto playback made simple, specially built for RecyclerView
Apache License 2.0
1.42k stars 253 forks source link

SimpleExoPlayerView streams video alright but i can only hear the audio but SimpleExoPlayerView is black itself #271

Closed denno640 closed 6 years ago

denno640 commented 6 years ago

i'm using Toro version 3.2.0 its an excellent library so thaaanks. i'm trying to stream video in recyclerview and load images as well all coming from local server(XAMPP)-for now. i have 3 viewholder classes, one for the images, one for video(i implement this using Toro) and one for a progressbar which is inflated at the end of a list. im also using exoplayer version r2.5.4. everything works perfectly except when streaming video. video audio plays but simpleexoplayerview is black and doesn't show anything. video being streamed is mp4. when scrolled out of view audio pauses and when it is on focus it plays. i'm not an android guru and i know problem could be with my code or even with exoplayer but since everything is integrated into this great library im hoping the author will be so kind as to help me. what i wish to achieve is stream video and show images(this part works fine) depending on the url coming from the api. i have tested this code using Infinix Zero 2 Android API 22 as well as genymotion emulator nexus 5 API 22. i have run the demo youtube app that comes with the library and it works fine. im using Container and im setting it up in a fragment which is part of a 3 fragment viewpager. here are my dependencies

implementation "im.ene.toro3:toro:3.2.0"
    //exoplayer dependencies
    implementation 'com.google.android.exoplayer:exoplayer-core:r2.5.4'
    implementation 'com.google.android.exoplayer:exoplayer-dash:r2.5.4'
    implementation 'com.google.android.exoplayer:exoplayer-ui:r2.5.4'
    implementation ('com.amitshekhar.android:android-networking:1.0.0') {
        transitive = true
        exclude module: 'gson'
    }
    implementation 'com.github.yalantis:ucrop:2.2.1-native'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.1.1'
    annotationProcessor 'com.jakewharton:butterknife:8.8.1' 

this is the video viewholder class housed inside my adapter class

public class DataAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    private Context context;
    public DataAdapter(final Context context, List<ComradeUser> comrades, RecyclerView recyclerView) {
        this.context = context;
        comradeUsers = comrades;
        setHasStableIds(true);
    }

    @Override
    public int getItemViewType(int position) {
     //left out code

        }
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent,
                                                      int viewType) {
        switch (viewType) {
            case 0:
                View v = LayoutInflater.from(parent.getContext()).inflate(
                        R.layout.progress_item, parent, false);
                return new ProgressViewHolder(v);
            case 1:
                View v2 = LayoutInflater.from(parent.getContext()).inflate(
                        R.layout.newer_cardview, parent, false);

                return new ProductViewHolder(v2);
            case 2:
                View v3 = LayoutInflater.from(parent.getContext()).inflate(
                        R.layout.horizontal_rvitem, parent, false);
                return new SuggestionRecyclerView(v3);
            case VD_VIEW:
                View v4 = LayoutInflater.from(parent.getContext()).inflate(
                        R.layout.custom_video_view, parent, false);
                return new MyViewHolder(v4);
            default:
                View v5 = LayoutInflater.from(parent.getContext()).inflate(R.layout.new_cardview, parent, false);
                return new ProductViewHolder(v5);
        }
    }

    @Override
    public long getItemId(int position) {
        //return super.getItemId(position);
        if (comradeUsers.get(position) != null) {
            return Long.parseLong(comradeUsers.get(position).getPosted_time());
        } else {
            return super.getItemId(position) + 1509902364000L;
        }
    }

    @Override
    //made holder final!
    public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
        //was final ProductViewHolder holder, final int position
       // Log.e("TAG", "onBindViewHolder called");
        if (holder instanceof ProductViewHolder) {
            ((ProductViewHolder) holder).bindData(comradeUsers.get(position));
        } else if (holder instanceof ProgressViewHolder) {
            ((ProgressViewHolder) holder).progressBar.setIndeterminate(true);
        } else if(holder instanceof MyViewHolder){
            String videoUrl = "http://192.168.103.1/slimapp/public/"+comradeUsers.get(position).getVideo_url();

                 Uri videoUri = Uri.parse(videoUrl);
                 ((MyViewHolder) holder).bind(videoUri);
        }else{
            if (CheeseListFragment.suggestionsItemList != null) {
                ((SuggestionRecyclerView) holder).horizontal_recyclerview.setHasFixedSize(true);
                ((SuggestionRecyclerView) holder).horizontal_recyclerview.setLayoutManager(
                        new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false));
                //SuggestedUserAdapter userAdapter = new SuggestedUserAdapter(context,CheeseListFragment.suggestedUserList);
                ((SuggestionRecyclerView) holder).horizontal_recyclerview.setAdapter(CheeseListFragment.suggestionsAdapter);
                //((SuggestionRecyclerView) holder).horizontal_recyclerview.setNestedScrollingEnabled(false);

            } else {
                //Toast.makeText(context, "list of suggestions is empty!", Toast.LENGTH_SHORT).show();
            }

        }
    }

    @Override
    public int getItemCount() {
        Log.e("TAG", "getItemCount called with comradeusers size of:" + comradeUsers.size());
        return comradeUsers.size();
    }

    public static class ProductViewHolder extends RecyclerView.ViewHolder {
        // private CardView cvProduct;
        //private int likes;
        private ImageView ivImage, viewed, tap_to_reload;

        private ProductViewHolder(View itemView) {
            super(itemView);
          //left out code for the image viewholder
        }
 public class MyViewHolder extends RecyclerView.ViewHolder implements ToroPlayer {
        static final int LAYOUT_RES = R.layout.custom_video_view;

        @Nullable
        SimpleExoPlayerViewHelper helper;
        @Nullable
        private Uri mediaUri;
        SimpleExoPlayerView playerView;

        public MyViewHolder(View x) {
            super(x);
            ButterKnife.bind(this, x);
            playerView=x.findViewById(R.id.player);
        }
        // called from Adapter to setup the media
        void bind(Uri item) {
            if (item != null) {
                mediaUri = item;
            }
        }

        @NonNull @Override public View getPlayerView() {
            return playerView;
        }

        @NonNull @Override public PlaybackInfo getCurrentPlaybackInfo() {
            return helper != null ? helper.getLatestPlaybackInfo() : new PlaybackInfo();
        }

        @Override
        public void initialize(@NonNull Container container, @NonNull PlaybackInfo playbackInfo) {
            if (helper == null) {
                helper = new SimpleExoPlayerViewHelper(container, this, mediaUri);
            }
            helper.initialize(playbackInfo);
        }

        @Override public void release() {
            if (helper != null) {
                helper.release();
                helper = null;
            }
        }

        @Override public void play() {
            if (helper != null) helper.play();
        }

        @Override public void pause() {
            if (helper != null) helper.pause();
        }

        @Override public boolean isPlaying() {
            return helper != null && helper.isPlaying();
        }

        @Override public boolean wantsToPlay() {
            return ToroUtil.visibleAreaOffset(this, itemView.getParent()) >= 0.85;
        }

        @Override public int getPlayerOrder() {
            return getAdapterPosition();
        }

        @Override
        public void onSettled(Container container) {

        }
    }

and here is the xml layout for the video view

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/card"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    app:cardBackgroundColor="@color/cardview_light_background"
    app:cardCornerRadius="0dp"
    app:cardElevation="1dp"
    >

    <com.google.android.exoplayer2.ui.SimpleExoPlayerView
        android:id="@+id/player"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="300dp"
        app:resize_mode="fixed_height"
        app:surface_type="texture_view"
        app:use_controller="false"
        />

</android.support.v7.widget.CardView>

here is my fragment

public class CheeseListFragment extends Fragment {
    View view;
    Container rvItem;
   //bunch of variables left out
    LinearLayoutManager manager;
    SwipeRefreshLayout mSwipeRefreshLayout;
    private StringRequest stringRequest;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        inflater.inflate(
                R.layout.fragment_home, container, false);

        animation = new RotateAnimation(0, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF
                , 0.5f);
        animation.setInterpolator(new LinearInterpolator());
        animation.setDuration(600);
        animation.setRepeatCount(Animation.INFINITE);
        context = getActivity();
        //ButterKnife.bind(getActivity());
        view = inflater.inflate(R.layout.fragment_home, container, false);
        rvItem = view.findViewById(R.id.my_fancy_videos);
        //////recyclerView = view.findViewById(R.id.rvItem);
        // recyclerView.setVisibility(View.GONE);
        retry_method = view.findViewById(R.id.retry_method);
        retry_method.setVisibility(GONE);
        handler = new Handler();

        comradeUserList = new ArrayList<>();
        suggestionsItemList = new ArrayList<>();
        suggestedUserList = new ArrayList<>();
        //adapter = new DataAdapter(context, comradeUserList, recyclerView);
        rvItem.setHasFixedSize(true);
        rvItem.addItemDecoration(new SimpleDividerItemDecoration(getResources()));
        manager = new LinearLayoutManager(context);
        rvItem.setLayoutManager(manager);
        adapter = new DataAdapter(context, comradeUserList, rvItem);
        suggestionsAdapter = new SuggestionsAdapter(context, suggestedUserList);
     //setting Container with my DataAdapter which extends RecyclerView.Adapter
        rvItem.setAdapter(adapter);
        loadData();//gets data from internet
        // recyclerView.setNestedScrollingEnabled(false);
        fetchSuggestions();//fetch some suggestions from server

        fab = view.findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                selectImageOption();
            }
        });
        retry_method.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                retryConnection();
            }
        });
        spin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                retryConnection();
            }
        });
        adapter.setOnLoadMoreListener(new OnLoadMoreListener() {
            @Override
            public void onLoadMore() {
                getMorePosts();
            }
        });
        smoothScroller = new LinearSmoothScroller(getActivity()) {
            @Override
            protected int getVerticalSnapPreference() {
                return LinearSmoothScroller.SNAP_TO_START;
            }
        };
        smoothScroller.setTargetPosition(0);

        return view;
    }

and the layout for the fragment

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="1dp"
    android:orientation="vertical"
    android:paddingBottom="20dp"
    android:fitsSystemWindows="true"
    tools:context="com.tsuma.user.comrade.HomeFragment">

        <ImageButton
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:id="@+id/spin_button"
            android:contentDescription="@string/next"
            app:srcCompat="@drawable/ic_autorenew_black_24dp"
            android:layout_centerHorizontal="true"
            android:layout_alignParentTop="true"
            android:background="@android:color/transparent"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/tap_to_retry"
            android:id="@+id/retry_method"
            android:visibility="visible"
         android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_marginEnd="95dp"
            android:layout_marginRight="95dp"
            android:layout_marginTop="10dp"
            />
<android.support.v4.widget.SwipeRefreshLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/mSwipeRefreshLayout">

    <im.ene.toro.widget.Container
        android:id="@+id/my_fancy_videos"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="vertical"
        android:fadeScrollbars="true"
        android:fitsSystemWindows="true"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:visibility="gone"
        />
</android.support.v4.widget.SwipeRefreshLayout>

    <!--app:layout_behavior="@string/appbar_scrolling_view_behavior"-->
    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center|end"
        android:layout_margin="@dimen/fab_margin"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_centerInParent="true"
        app:srcCompat="@drawable/ic_control_point_black_24dp"

        />

</RelativeLayout>

it is the first time posting on github so sorry for too much information. please help

eneim commented 6 years ago

@denno640 Hi there, thanks for the detail. Do you see any weird logcat when the Video turns black? Something looks like error from decoder or ExoPlayer renderer, etc?

denno640 commented 6 years ago

@eneim here is the logcat.

12-11 08:14:10.331 20609-20775/com.tsuma.user.comrade I/System.out: open:http://192.168.103.1/slimapp/public/img/VID_22_1512658669000.mp4
12-11 08:14:10.331 20609-20775/com.tsuma.user.comrade D/libc-netbsd: [getaddrinfo]: hostname=192.168.103.1; servname=(null); cache_mode=(null), netid=0; mark=0
12-11 08:14:10.331 20609-20775/com.tsuma.user.comrade D/libc-netbsd: [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=4; ai_family=0
12-11 08:14:10.331 20609-20776/com.tsuma.user.comrade I/System.out: open:http://192.168.103.1/slimapp/public/img/VID_22_1512662280000.mp4
12-11 08:14:10.332 20609-20775/com.tsuma.user.comrade I/System.out: [CDS]rx timeout:8000
12-11 08:14:10.332 20609-20775/com.tsuma.user.comrade I/System.out: [OkHttp] sendRequest>>
12-11 08:14:10.332 20609-20775/com.tsuma.user.comrade I/System.out: [OkHttp] sendRequest<<
12-11 08:14:10.333 20609-20776/com.tsuma.user.comrade D/libc-netbsd: [getaddrinfo]: hostname=192.168.103.1; servname=(null); cache_mode=(null), netid=0; mark=0
12-11 08:14:10.333 20609-20776/com.tsuma.user.comrade D/libc-netbsd: [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=4; ai_family=0
12-11 08:14:10.333 20609-20776/com.tsuma.user.comrade I/System.out: [CDS]rx timeout:8000
12-11 08:14:10.333 20609-20776/com.tsuma.user.comrade I/System.out: [OkHttp] sendRequest>>
12-11 08:14:10.333 20609-20776/com.tsuma.user.comrade I/System.out: [OkHttp] sendRequest<<
12-11 08:14:10.342 20609-20609/com.tsuma.user.comrade V/InputMethodManager: START INPUT: im.ene.toro.widget.Container{2f64ab68 VFED.V.. .F....I. 0,0-720,996 #7f09013e app:id/my_fancy_videos} ic=null tba=android.view.inputmethod.EditorInfo@231633cf controlFlags=#100
12-11 08:14:10.343 20609-20609/com.tsuma.user.comrade E/SUGGESTIONS: size of suggestedcomrades:7
12-11 08:14:10.418 20609-20773/com.tsuma.user.comrade W/AudioCapabilities: Unsupported mime audio/x-adpcm-ms
12-11 08:14:10.420 20609-20773/com.tsuma.user.comrade W/AudioCapabilities: Unsupported mime audio/x-adpcm-dvi-ima
12-11 08:14:10.428 20609-20773/com.tsuma.user.comrade W/AudioCapabilities: Unsupported mime audio/ape
12-11 08:14:10.429 20609-20773/com.tsuma.user.comrade W/AudioCapabilities: Unsupported mime audio/alac
12-11 08:14:10.435 20609-20773/com.tsuma.user.comrade W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
12-11 08:14:10.450 20609-20773/com.tsuma.user.comrade W/VideoCapabilities: Unsupported mime video/x-ms-wmv
12-11 08:14:10.453 20609-20773/com.tsuma.user.comrade W/VideoCapabilities: Unsupported mime video/divx
12-11 08:14:10.455 20609-20773/com.tsuma.user.comrade W/VideoCapabilities: Unsupported mime video/xvid
12-11 08:14:10.458 20609-20773/com.tsuma.user.comrade W/VideoCapabilities: Unsupported mime video/flv1
12-11 08:14:10.466 195-1993/? I/BufferQueueProducer: [com.tsuma.user.comrade/com.tsuma.user.comrade.New_HomePage](this:0xb5c55c00,id:1458,api:2,p:20609,c:195) queueBuffer: fps=44.29 dur=1038.61 max=202.78 min=14.52
12-11 08:14:10.488 20609-20773/com.tsuma.user.comrade W/AudioCapabilities: Unsupported mime audio/x-adpcm-ms
12-11 08:14:10.490 20609-20773/com.tsuma.user.comrade W/AudioCapabilities: Unsupported mime audio/x-adpcm-dvi-ima
12-11 08:14:10.511 20609-20774/com.tsuma.user.comrade I/MediaCodec: [CreateByComponentName]line:155 OMX.google.aac.decoder
12-11 08:14:10.511 20609-20774/com.tsuma.user.comrade D/ACodec: Now uninitialized
12-11 08:14:10.515 20609-20777/com.tsuma.user.comrade I/MediaCodec: [onMessageReceived]line:1296 [][what=kWhatInit][state 0][msg='AMessage(what = 'init', target = 2) = {
                                                                      string name = "OMX.google.aac.decoder"
                                                                      int32_t nameIsType = 0
                                                                      int32_t replyID = 1
                                                                    }' ]
12-11 08:14:10.516 20609-20777/com.tsuma.user.comrade D/ACodec: onAllocateComponent
12-11 08:14:10.517 20609-20777/com.tsuma.user.comrade I/OMXClient: Using client-side OMX mux.
12-11 08:14:10.517 20609-20777/com.tsuma.user.comrade D/ACodec: mDeathNotifier is set
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: Core_Init called
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: Core_Init gInstancePoolLock init
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: +MTK_OMX_Init tick=1512969250520
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: +ParseMtkCoreConfig
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: ParseMtkCoreConfig: gCoreComponentCounts = 30
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: -ParseMtkCoreConfig
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: Mtk_OMX_Init gCoreComponents 0xafa34000
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: +++++ dump_core_comp_table +++++
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.VIDEO.DECODER.HEVC), role(video_decoder.hevc), path(libMtkOmxVdec.so)
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.VIDEO.DECODER.H263), role(video_decoder.h263), path(libMtkOmxVdec.so)
12-11 08:14:10.520 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.AUDIO.DECODER.FLAC), role(audio_decoder.flac), path(libMtkOmxFlacDec.so)
12-11 08:14:10.527 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.AUDIO.DECODER.ADPCM.MS), role(audio_decoder.adpcm), path(libMtkOmxAdpcmDec.so)
12-11 08:14:10.527 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.AUDIO.DECODER.ADPCM.DVI), role(audio_decoder.adpcm), path(libMtkOmxAdpcmDec.so)
12-11 08:14:10.527 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.AUDIO.ENCODER.ADPCM.MS), role(audio_encoder.adpcm), path(libMtkOmxAdpcmEnc.so)
12-11 08:14:10.527 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.AUDIO.ENCODER.ADPCM.DVI), role(audio_encoder.adpcm), path(libMtkOmxAdpcmEnc.so)
12-11 08:14:10.527 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.AUDIO.DECODER.RAW), role(audio_decoder.raw), path(libMtkOmxRawDec.so)
12-11 08:14:10.527 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.AUDIO.DECODER.GSM), role(audio_decoder.gsm), path(libMtkOmxGsmDec.so)
12-11 08:14:10.527 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: name(OMX.MTK.AUDIO.DECODER.ALAC), role(audio_decoder.alac), path(libMtkOmxAlacDec.so)
12-11 08:14:10.527 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: ----- dump_core_comp_table -----
12-11 08:14:10.527 20609-20777/com.tsuma.user.comrade D/MtkOmxCore: -MTK_OMX_Init tick=1512969250527
12-11 08:14:10.533 20609-20777/com.tsuma.user.comrade D/ACodec: [OMX.google.aac.decoder] Now Loaded
12-11 08:14:10.533 20609-20777/com.tsuma.user.comrade I/MediaCodec: [onMessageReceived]line:940 [][what=kWhatComponentAllocated][state 1][msg='AMessage(what = 'codc', target = 2) = {
                                                                      int32_t what = 1665231980
                                                                      string componentName = "OMX.google.aac.decoder"
                                                                      int32_t quirks = 0
                                                                    }' ]
12-11 08:14:10.534 20609-20774/com.tsuma.user.comrade I/MediaCodec: [CreateByComponentName]line:162 OMX.google.aac.decoder
12-11 08:14:10.535 20609-20777/com.tsuma.user.comrade I/MediaCodec: Found 1 pieces of codec specific data.
12-11 08:14:10.535 20609-20777/com.tsuma.user.comrade D/ACodec: onConfigureComponent
12-11 08:14:10.536 20609-20777/com.tsuma.user.comrade E/ACodec: cannot find aac bit rate
12-11 08:14:10.536 20609-20777/com.tsuma.user.comrade D/ACodec: acodec.video.bstrdump 0
12-11 08:14:10.536 20609-20777/com.tsuma.user.comrade D/ACodec: acodec.video.rawdump 0
12-11 08:14:10.536 20609-20777/com.tsuma.user.comrade D/ACodec: sendFormatChange 0
12-11 08:14:10.536 20609-20777/com.tsuma.user.comrade D/ACodec: sendFormatChange 0
12-11 08:14:10.536 20609-20777/com.tsuma.user.comrade E/OMXNodeInstance: getParameter(1:google.aac.decoder, ??(0x7f200406)) ERROR: UnsupportedIndex(0x8000101a)
12-11 08:14:10.536 20609-20777/com.tsuma.user.comrade I/MediaCodec: [onMessageReceived]line:967 [OMX.google.aac.decoder][what=kWhatComponentConfigured][state 3][msg='AMessage(what = 'codc', target = 2) = {
                                                                      int32_t what = 1665363822
                                                                      AMessage input-format = AMessage(what = 0x00000000) = {
                                                                                                int32_t support-partial-frame = 0
                                                                                                string mime = "audio/mp4a-latm"
                                                                                                int32_t channel-count = 1
                                                                                                int32_t sample-rate = 44100
                                                                                                int32_t aac-profile = 1
                                                                                              }
                                                                      AMessage output-format = AMessage(what = 'codc', target = 2) = {
                                                                                                 string mime = "audio/raw"
                                                                                                 int32_t channel-count = 1
                                                                                                 int32_t sample-rate = 44100
                                                                                                 int32_t bit-width = 16
                                                                                               }
                                                                    }' ]
12-11 08:14:10.538 20609-20774/com.tsuma.user.comrade I/MediaCodec: [start]line:344 [OMX.google.aac.decoder]+++
12-11 08:14:10.538 20609-20777/com.tsuma.user.comrade D/ACodec: onStart

12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: useBuffer[2], mBufferID(0xaf882be0)
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1f20000, size = 8192
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: useBuffer[3], mBufferID(0xaf882c40)
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1f22000, size = 8192
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: [OMX.google.aac.decoder] Allocating 4 buffers of size 32768 on output port
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: useBuffer[0], mBufferID(0xaf882ca0)
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1c0a000, size = 32768
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: useBuffer[1], mBufferID(0xaf882d00)
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1c12000, size = 32768
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: useBuffer[2], mBufferID(0xaf882d60)
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1c1a000, size = 32768
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: useBuffer[3], mBufferID(0xaf882dc0)
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1c22000, size = 32768
12-11 08:14:10.539 20609-20777/com.tsuma.user.comrade I/MediaCodec: [onMessageReceived]line:1024 [OMX.google.aac.decoder][what=kWhatBuffersAllocated][state 5][msg='AMessage(what = 'codc', target = 2) = {
                                                                      int32_t what = 1634495587
                                                                      int32_t portIndex = 0
                                                                      RefBase *portDesc = 0xafa9d220
                                                                    }' ]
12-11 08:14:10.540 20609-20777/com.tsuma.user.comrade I/MediaCodec: [onMessageReceived]line:1024 [OMX.google.aac.decoder][what=kWhatBuffersAllocated][state 5][msg='AMessage(what = 'codc', target = 2) = {
                                                                      int32_t what = 1634495587
                                                                      int32_t portIndex = 1
                                                                      RefBase *portDesc = 0xafa9d340
                                                                    }' ]

12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1c0a000, size = 32768
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: useBuffer[1], mBufferID(0xaf882d60)
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1c12000, size = 32768
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: useBuffer[2], mBufferID(0xaf882d00)
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1c1a000, size = 32768
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: useBuffer[3], mBufferID(0xaf882ca0)
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: @debug: buffer = 0xa1c22000, size = 32768
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade I/MediaCodec: [onMessageReceived]line:1024 [OMX.google.aac.decoder][what=kWhatBuffersAllocated][state 6][msg='AMessage(what = 'codc', target = 2) = {
                                                                      int32_t what = 1634495587
                                                                      int32_t portIndex = 1
                                                                      RefBase *portDesc = 0xafa9d5e0
                                                                    }' ]
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: OutputPortSettingsChangedState::onMessageReceived msg->what() 6f6d7820
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: OutputPortSettingsChangedState::onOMXEvent event 0, 3, 1
12-11 08:14:10.547 20609-20777/com.tsuma.user.comrade D/ACodec: [OMX.google.aac.decoder] Output port now reenabled.

my logging level was set at error. i can see some UNSUPPORTED THINGS in my logs now and it freaks me. sorry for the late response.

denno640 commented 6 years ago

@einem after many hours of scrutinizing my code i found the culprit. I had previously set hardware acceleration to false. I activated hardware acceleration in my application manifest and now its working perfectly.

eneim commented 6 years ago

@denno640 sounds good to hear that.