This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
lavf: add Android content resolver protocol support
Handles uri starting with content://.
- Loading branch information
Showing
6 changed files
with
241 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com> | ||
| * | ||
| * This file is part of FFmpeg. | ||
| * | ||
| * FFmpeg is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 2.1 of the License, or (at your option) any later version. | ||
| * | ||
| * FFmpeg is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with FFmpeg; if not, write to the Free Software | ||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| */ | ||
|
|
||
| #include <pthread.h> | ||
|
|
||
| #include "android_content.h" | ||
|
|
||
| static void *android_app_ctx; | ||
| static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; | ||
|
|
||
| void av_android_content_set_app_ctx(void *ctx) | ||
| { | ||
| pthread_mutex_lock(&lock); | ||
| android_app_ctx = ctx; | ||
| pthread_mutex_unlock(&lock); | ||
| } | ||
|
|
||
| void *av_android_content_get_app_ctx(void) | ||
| { | ||
| void *ctx; | ||
|
|
||
| pthread_mutex_lock(&lock); | ||
| ctx = android_app_ctx; | ||
| pthread_mutex_unlock(&lock); | ||
|
|
||
| return ctx; | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com> | ||
| * | ||
| * This file is part of FFmpeg. | ||
| * | ||
| * FFmpeg is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 2.1 of the License, or (at your option) any later version. | ||
| * | ||
| * FFmpeg is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with FFmpeg; if not, write to the Free Software | ||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| */ | ||
|
|
||
| #ifndef AVFORMAT_ANDROID_CONTENT_H | ||
| #define AVFORMAT_ANDROID_CONTENT_H | ||
|
|
||
| void av_android_content_set_app_ctx(void *ctx); | ||
| void *av_android_content_get_app_ctx(void); | ||
|
|
||
| #endif /* AVFORMAT_ANDROID_CONTENT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters