Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 371972 Details for
Bug 477780
dev-java/libjitsi - Secure Audio/Video Communication for Java Applications
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
libjitsi-libav10.patch
libjitsi-libav10.patch (text/plain), 3.08 KB, created by
Guillaume Horel
on 2014-03-07 19:02:10 UTC
(
hide
)
Description:
libjitsi-libav10.patch
Filename:
MIME Type:
Creator:
Guillaume Horel
Created:
2014-03-07 19:02:10 UTC
Size:
3.08 KB
patch
obsolete
>Index: jitsi-2.4.4997/lib/src/libjitsi/src/native/ffmpeg/org_jitsi_impl_neomedia_codec_FFmpeg.c >=================================================================== >--- jitsi-2.4.4997.orig/lib/src/libjitsi/src/native/ffmpeg/org_jitsi_impl_neomedia_codec_FFmpeg.c 2014-02-27 05:10:28.000000000 +0000 >+++ jitsi-2.4.4997/lib/src/libjitsi/src/native/ffmpeg/org_jitsi_impl_neomedia_codec_FFmpeg.c 2014-02-27 16:45:02.128964921 +0000 >@@ -163,14 +163,28 @@ > = (*env)->GetByteArrayElements (env, samples, NULL); > > if (samples_ptr) { >- ret = (jint) avcodec_encode_audio( >- (AVCodecContext *) (intptr_t) ctx, >- (uint8_t *) (buf_ptr + buf_offset), (int) buf_size, >- (const short *) (samples_ptr + samples_offset)); >+ AVCodecContext *avctx = (AVCodecContext*)(intptr_t)ctx; >+ AVPacket pkt; >+ AVFrame *frame = av_frame_alloc(); >+ int got_output; >+ >+ if (!frame) >+ return AVERROR(ENOMEM); >+ frame->data[0] = (uint8_t*)(samples_ptr + samples_offset); >+ frame->linesize[0] = avctx->frame_size * av_get_bytes_per_sample(avctx->sample_fmt) * >+ avctx->channels; >+ >+ pkt.data = (uint8_t*)(buf_ptr + buf_offset); >+ pkt.size = buf_size; >+ ret = (jint) avcodec_encode_audio2( >+ avctx, &pkt, frame, &got_output); > (*env)->ReleaseByteArrayElements( > env, > samples, samples_ptr, > JNI_ABORT); >+ av_frame_free(&frame); >+ if (ret >= 0) >+ ret = got_output ? pkt.size : 0; > } else > ret = -1; > (*env)->ReleaseByteArrayElements (env, buf, buf_ptr, 0); >@@ -192,12 +206,18 @@ > jbyte *buf_ptr = (*env)->GetByteArrayElements (env, buf, NULL); > > if (buf_ptr) { >+ int got_output; >+ AVPacket pkt; >+ pkt.data = (uint8_t*)buf_ptr; >+ pkt.size = (int)buf_size; > ret > = (jint) >- avcodec_encode_video( >+ avcodec_encode_video2( > (AVCodecContext *) (intptr_t) ctx, >- (uint8_t *) buf_ptr, (int) buf_size, >- (const AVFrame *) (intptr_t) frame); >+ &pkt, (const AVFrame *) (intptr_t) frame, >+ &got_output); >+ if (ret >= 0) >+ ret = got_output ? pkt.size : 0; > (*env)->ReleaseByteArrayElements (env, buf, buf_ptr, 0); > } else > ret = -1; >@@ -210,14 +230,14 @@ > Java_org_jitsi_impl_neomedia_codec_FFmpeg_avcodec_1find_1decoder > (JNIEnv *env, jclass clazz, jint id) > { >- return (jlong) (intptr_t) avcodec_find_decoder((enum CodecID) id); >+ return (jlong) (intptr_t) avcodec_find_decoder((enum AVCodecID) id); > } > > JNIEXPORT jlong JNICALL > Java_org_jitsi_impl_neomedia_codec_FFmpeg_avcodec_1find_1encoder > (JNIEnv *env, jclass clazz, jint id) > { >- return (jlong) (intptr_t) avcodec_find_encoder((enum CodecID) id); >+ return (jlong) (intptr_t) avcodec_find_encoder((enum AVCodecID) id); > } > > JNIEXPORT jint JNICALL
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 477780
:
371966
|
371968
|
371970
| 371972