|
|
@ -24,7 +24,6 @@ AVFilterGraph *filter_graph; |
|
|
|
|
|
|
|
|
|
|
|
AVFormatContext *pFormatCtx; |
|
|
|
AVFormatContext *pFormatCtx; |
|
|
|
AVCodecContext *pCodecCtx; |
|
|
|
AVCodecContext *pCodecCtx; |
|
|
|
ANativeWindow_Buffer windowBuffer; |
|
|
|
|
|
|
|
ANativeWindow *nativeWindow; |
|
|
|
ANativeWindow *nativeWindow; |
|
|
|
|
|
|
|
|
|
|
|
int again; |
|
|
|
int again; |
|
|
@ -339,6 +338,7 @@ VIDEO_PLAYER_FUNC(jint, filter, jstring filePath, jobject surface, jint position |
|
|
|
ret = av_buffersink_get_frame(buffersink_ctx, filter_frame); |
|
|
|
ret = av_buffersink_get_frame(buffersink_ctx, filter_frame); |
|
|
|
if (ret >= 0) { |
|
|
|
if (ret >= 0) { |
|
|
|
// lock native window
|
|
|
|
// lock native window
|
|
|
|
|
|
|
|
ANativeWindow_Buffer windowBuffer; |
|
|
|
ANativeWindow_lock(nativeWindow, &windowBuffer, 0); |
|
|
|
ANativeWindow_lock(nativeWindow, &windowBuffer, 0); |
|
|
|
// convert
|
|
|
|
// convert
|
|
|
|
sws_scale(sws_ctx, (uint8_t const *const *) filter_frame->data, |
|
|
|
sws_scale(sws_ctx, (uint8_t const *const *) filter_frame->data, |
|
|
@ -380,8 +380,8 @@ end: |
|
|
|
av_free(filter_frame); |
|
|
|
av_free(filter_frame); |
|
|
|
av_free(pFrame); |
|
|
|
av_free(pFrame); |
|
|
|
|
|
|
|
|
|
|
|
// free(audio_track);
|
|
|
|
audio_track = NULL; |
|
|
|
// free(&windowBuffer);
|
|
|
|
audio_track_write_mid = NULL; |
|
|
|
ANativeWindow_release(nativeWindow); |
|
|
|
ANativeWindow_release(nativeWindow); |
|
|
|
(*env)->ReleaseStringUTFChars(env, filePath, file_name); |
|
|
|
(*env)->ReleaseStringUTFChars(env, filePath, file_name); |
|
|
|
LOGE(TAG, "do release..."); |
|
|
|
LOGE(TAG, "do release..."); |
|
|
|