Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg: libjniaudio on gingerbread #1

Open
alexcohn opened this issue May 1, 2011 · 0 comments
Open

ffmpeg: libjniaudio on gingerbread #1

alexcohn opened this issue May 1, 2011 · 0 comments

Comments

@alexcohn
Copy link

alexcohn commented May 1, 2011

Hi,

I tried to run the ffpmeg app on Galaxy S with v. 2.3.3. Issue #1 was with libjniaudio - due to change of signature of android::AudioTrack::set().

Follows my patch for audiotrack.cpp, function AndroidAudioTrack_set():

status_t ret = NAME_NOT_FOUND;

void *lptr_media = dlopen("libmedia.so", 0);
__android_log_print(ANDROID_LOG_DEBUG, TAG, "dlopen returns %p", lptr_media);

if (lptr_media)         // first, try gingerbread
{
    status_t (*fptr_set)(AudioTrack* track,
                        int streamType,
                        uint32_t sampleRate,
                        int format,
                        int channels,
                        int frameCount,
                        uint32_t flags,
                        AudioTrack::callback_t cbf,
                        void* user,
                        int notificationFrames,
                        const sp<IMemory>& sharedBuffer,
                        bool threadCanCallJava,
                        int sessionId);

    fptr_set = (typeof fptr_set)dlsym(lptr_media, "_ZN7android10AudioTrack3setEijiiijPFviPvS1_ES1_iRKNS_2spINS_7IMemoryEEEbi");
    __android_log_print(ANDROID_LOG_DEBUG, TAG, "dlsym returns %p", fptr_set);

    if (fptr_set != 0)
    {
        ret = fptr_set(track,
                       streamType,
                       sampleRate,
                       format,
                       channels,
                       0, 0, 0, 0, 0, 0, 0, 0);
        __android_log_print(ANDROID_LOG_DEBUG, TAG, "fptr_set() returns %d", ret);
        dlclose(lptr_media);
        lptr_media = 0;
    }
}

if (lptr_media)         // second, try froyo
{
    status_t (*fptr_set)(AudioTrack* track,
                        int streamType,
                        uint32_t sampleRate,
                        int format,
                        int channels,
                        int frameCount,
                        uint32_t flags,
                        AudioTrack::callback_t cbf,
                        void* user,
                        int notificationFrames,
                        const sp<IMemory>& sharedBuffer,
                        bool threadCanCallJava);

    fptr_set = (typeof fptr_set)dlsym(lptr_media, "_ZN7android10AudioTrack3setEijiiijPFviPvS1_ES1_iRKNS_2spINS_7IMemoryEEEb");
    __android_log_print(ANDROID_LOG_INFO, TAG, "dlsym returns %p", fptr_set);

    if (fptr_set != 0)
    {
        ret = fptr_set(track,
                       streamType,
                       sampleRate,
                       format,
                       channels,
                       0, 0, 0, 0, 0, 0, 0); // push max number of parameters
        __android_log_print(ANDROID_LOG_INFO, TAG, "fptr_set() returns %d", ret);
        dlclose(lptr_media);
        lptr_media = 0;
    }
}

if (lptr_media)         // finally, close library anyway
{
    dlclose(lptr_media);
}
havlenapetr pushed a commit that referenced this issue Dec 7, 2011
Some (including the Contacts app) do the following:
  1. Open database
  2. As part of database_connection.onCreate(),
       Create some SQLiteStatement objects to cache them in the process
  3. attach databases
WAL doesn't work with attached databases. so, apps doing the above
should enable WAL only if there are no attached databases.

But we would like to enable WAL automatically for all apps after step #1 above
and disable WAL if the app subsequently does 'attach database' SQL.

this works only if there are no SQLiteStatement objects created in step # 2,
because SQLiteStatements cwmaintain a hard-reference to the database connection
for life and also to the prepared SQL statement id.
It is quite difficult to disable WAL in step # 3
    if it is enabled in step # 1
    and then a connection pool gets used by step # 2

would make WAL disabling easier if SQLiteStatement refers to prepared SQL
statement id only when it is needed (during binding and execute calls)
and thus NOT tied to a spacific database conenction.

also, from the standpoint of not blocking readers, it helps NOT to have
SQLiteStatement be married to a database connection and prepared SQL statement
id for life.

Change-Id: I464d57042965a28d2bde88e0f44b66ec119b40dc
havlenapetr pushed a commit that referenced this issue Dec 7, 2011
Of note:

1. There is no "X" (veto) button anymore. (Well, there is,
   but it's offscreen so it should still be available to
   assistive devices.) Users can use "Clear all" or the new
   swipe-to-veto gesture to clear notifications.

2. As a consequence of #1, your layout goes all the way to
   the right edge of the notifications panel again. Enjoy
   the extra space!

3. The numeric bubble in the notification icon is now capped
   at "999+" like it is in the expanded notification view.
   (Note that this involves a couple of new public framework
   resources: one to indicate the number beyond which the
   substitution string will be used, and one specifying a
   localizable substitution string.)

Bug: 4651514
Bug: 4686329
Bug: 4501990
Change-Id: I0e6bdb6aec4fe5bfc927eb1aba955d444a9414ec
havlenapetr pushed a commit that referenced this issue Dec 7, 2011
Also improve history formatting
Here's a smaple of what it looks like:

Detailed Statistics (Recent history):  20  40s
-------------------------------------------------------------------------------------
  com.android.contacts                                        : 9/45%      11/27%
    [email protected]/com.google                            :   3/15%      4/11%
    [email protected]/com.google                            :   3/15%      3/9%
    [email protected]/com.google                             :   3/15%      2/6%
-------------------------------------------------------------------------------------
  gmail-ls                                                    : 6/30%      22/56%
-------------------------------------------------------------------------------------
  com.android.calendar                                        : 3/15%      5/14%
    [email protected]/com.google                            :   1/5%       4/12%
    [email protected]/com.google                            :   1/5%       0/0%
    [email protected]/com.google                             :   1/5%       0/0%
-------------------------------------------------------------------------------------
  com.google.android.apps.plus.content.EsGooglePhotoProvider  : 2/10%      0/1%
    [email protected]/com.google                            :   1/5%       0/1%
    [email protected]/com.google                            :   1/5%       0/0%
-------------------------------------------------------------------------------------

Recent Sync History
  #1  : 2011-09-23 15:18:35   SERVER    0.8s  [email protected]/com.google   gmail-ls
  #2  : 2011-09-23 15:17:56   SERVER    1.3s  00:38
  #3  : 2011-09-23 15:17:52   SERVER    4.6s  00:04
  #4  : 2011-09-23 15:17:45   SERVER    1.7s  00:06
  #5  : 2011-09-23 15:16:51    LOCAL    0.8s  [email protected]/com.google  com.android.contacts
  #6  : 2011-09-23 15:16:51    LOCAL    0.7s  [email protected]/com.google   com.android.contacts
  #7  : 2011-09-23 15:16:50    LOCAL    0.7s  [email protected]/com.google  com.android.contacts
  #8  : 2011-09-23 15:15:35    LOCAL    0.7s  [email protected]/com.google   com.android.contacts
  #9  : 2011-09-23 15:15:34    LOCAL    0.8s  [email protected]/com.google  com.android.contacts
  #10 : 2011-09-23 15:15:33    LOCAL    1.9s  [email protected]/com.google  com.android.contacts
  #11 : 2011-09-23 15:14:37    LOCAL    1.3s  [email protected]/com.google   com.android.contacts
  #12 : 2011-09-23 15:14:35    LOCAL    2.0s  [email protected]/com.google  com.android.contacts
  #13 : 2011-09-23 15:14:32    LOCAL    2.2s  [email protected]/com.google  com.android.contacts
  #14 : 2011-09-23 15:13:41   SERVER    1.3s  [email protected]/com.google   gmail-ls
  #15 : 2011-09-23 15:13:34    LOCAL    0.3s  [email protected]/com.google   com.android.calendar
  #16 : 2011-09-23 15:13:34    LOCAL    0.4s  [email protected]/com.google  com.android.calendar
  #17 : 2011-09-23 15:13:33   SERVER    0.1s  [email protected]/com.google  com.google.android.apps.plus.content.EsGooglePhotoProvider
  #18 : 2011-09-23 15:13:33   SERVER    0.5s  [email protected]/com.google  com.google.android.apps.plus.content.EsGooglePhotoProvider
  #19 : 2011-09-23 15:13:29    LOCAL    4.9s  [email protected]/com.google  com.android.calendar
  #20 : 2011-09-23 15:13:28   SERVER   13.1s  [email protected]/com.google   gmail-ls

Change-Id: Idc904e2e18a373b6d2d10af65b02683c11fd8d90
havlenapetr pushed a commit that referenced this issue Dec 7, 2011
After using the new format for a few days, I decided it's better to ahve the auth & acct
info on every row because we will sometimes grep the data and won't see it if the auth/acct
is ommited.

Also added the "time since last sync" to every row. This is also very useful.

Detailed Statistics (Recent history):  31 (# of times) 119s (sync time)
-------------------------------------------------------------------------------------
  subscribedfeeds                                             : 8/25%      17s/14%
    [email protected]/com.google                            :   5/16%      16s/13%
    [email protected]/com.google                            :   3/9%       1s/0%
-------------------------------------------------------------------------------------
  com.android.calendar                                        : 5/16%      10s/8%
    [email protected]/com.google                            :   3/9%       0s/0%
    [email protected]/com.google                            :   2/6%       9s/8%
-------------------------------------------------------------------------------------
  com.google.android.apps.books                               : 3/9%       26s/22%
-------------------------------------------------------------------------------------
  com.android.contacts                                        : 3/9%       14s/11%
    [email protected]/com.google                            :   2/6%       9s/7%
    [email protected]/com.google                            :   1/3%       5s/4%
-------------------------------------------------------------------------------------
  com.android.browser                                         : 3/9%       12s/10%
-------------------------------------------------------------------------------------
  com.google.android.music.MusicContent                       : 3/9%       7s/6%
-------------------------------------------------------------------------------------
  gmail-ls                                                    : 2/6%       12s/10%
-------------------------------------------------------------------------------------
  com.google.android.apps.plus.content.EsGooglePhotoProvider  : 2/6%       1s/0%
    [email protected]/com.google                            :   1/3%       1s/0%
    [email protected]/com.google                            :   1/3%       0s/0%
-------------------------------------------------------------------------------------
  com.google.android.apps.plus.content.EsProvider             : 1/3%       10s/9%
-------------------------------------------------------------------------------------
  com.google.android.gallery3d.GooglePhotoProvider            : 1/3%       5s/5%
-------------------------------------------------------------------------------------

Recent Sync History
  #1  : 2011-10-03 13:26:41   SERVER    0.0s            [email protected]/com.google  com.android.calendar
  #2  : 2011-10-03 13:26:40    LOCAL    1.8s            [email protected]/com.google  subscribedfeeds
  #3  : 2011-10-03 13:26:40    LOCAL    0.1s            [email protected]/com.google  subscribedfeeds
  #4  : 2011-10-03 13:26:37   SERVER    0.1s         4  [email protected]/com.google  com.android.calendar
  #5  : 2011-10-03 13:26:37    LOCAL    0.1s            [email protected]/com.google  com.google.android.apps.books
  #6  : 2011-10-03 13:26:30   SERVER    0.9s         7  [email protected]/com.google  com.google.android.apps.books
  #7  : 2011-10-03 13:26:25   SERVER    1.1s            [email protected]/com.google  gmail-ls
  #8  : 2011-10-03 13:26:13   SERVER   11.8s        11  [email protected]/com.google  gmail-ls
  #9  : 2011-10-03 13:26:08   SERVER    5.0s            [email protected]/com.google  com.android.contacts
  #10 : 2011-10-03 13:26:08   SERVER    0.7s        29  [email protected]/com.google  com.android.calendar
  #11 : 2011-10-03 13:26:07   SERVER    0.7s            [email protected]/com.google  com.android.browser
  #12 : 2011-10-03 13:26:04   SERVER    3.0s         2  [email protected]/com.google  com.android.browser
  #13 : 2011-10-03 13:26:04   SERVER   25.9s        25  [email protected]/com.google  com.google.android.apps.books

Change-Id: I8da004f469d136fd9a86310b262eba61197fd0e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant