diff options
author | Boyuan Zhang <[email protected]> | 2017-11-07 16:20:05 -0500 |
---|---|---|
committer | Leo Liu <[email protected]> | 2017-11-17 12:25:47 -0500 |
commit | 47443bc9f054a31b1ba92890a25655953116e080 (patch) | |
tree | 4b3abdd983738e738e2a62e7f3869237b9744b4f | |
parent | f40fe728a1fb077cf288661af7892056c7fd0169 (diff) |
radeon/vcn: add encode bitstream
Add implementation for encode_bitstream interface for vcn encode.
Signed-off-by: Boyuan Zhang <[email protected]>
Acked-by: Christian König <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vcn_enc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c index 0a2c5d86de2..f78672a1b1a 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_enc.c +++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c @@ -155,7 +155,19 @@ static void radeon_enc_encode_bitstream(struct pipe_video_codec *encoder, struct pipe_resource *destination, void **fb) { - /* TODO*/ + struct radeon_encoder *enc = (struct radeon_encoder*)encoder; + enc->get_buffer(destination, &enc->bs_handle, NULL); + enc->bs_size = destination->width0; + + *fb = enc->fb = CALLOC_STRUCT(rvid_buffer); + + if (!si_vid_create_buffer(enc->screen, enc->fb, 4096, PIPE_USAGE_STAGING)) { + RVID_ERR("Can't create feedback buffer.\n"); + return; + } + + enc->need_feedback = true; + enc->encode(enc); } static void radeon_enc_end_frame(struct pipe_video_codec *encoder, |