<commit_before>#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"

#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <SDL/SDL.h>


MODULE = UAV::Pilot::SDL::Video    PACKAGE = UAV::Pilot::SDL::Video


void
_draw_last_video_frame( self, overlay, dstrect, frame_sv)
        SV* self
        SDL_Overlay* overlay
        SDL_Rect* dstrect
        SV* frame_sv
    PPCODE:
        AVFrame* frame = (AVFrame*) SvIV( frame_sv );
        AVPicture pict;
        struct SwsContext * sws_context = sws_getContext( // TODO put into MY_CXT
            dstrect->w,
            dstrect->h,
            PIX_FMT_YUV420P, // TODO get from codec context
            dstrect->w,
            dstrect->h,
            PIX_FMT_YUV420P,
            SWS_FAST_BILINEAR,
            NULL,
            NULL,
            NULL
        );

        if( sws_context == NULL ) {
            warn( "Could not get SWS context\n" );<commit_msg>SDL::Video uses uav.h<commit_after>#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "uav.h"

#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <SDL/SDL.h>


MODULE = UAV::Pilot::SDL::Video    PACKAGE = UAV::Pilot::SDL::Video


void
_draw_last_video_frame( self, overlay, dstrect, frame_sv)
        SV* self
        SDL_Overlay* overlay
        SDL_Rect* dstrect
        SV* frame_sv
    PPCODE:
        AVFrame* frame = (AVFrame*) SvIV( frame_sv );
        AVPicture pict;
        struct SwsContext * sws_context = sws_getContext(
            dstrect->w,
            dstrect->h,
            UAV_PIX_FMT,
            dstrect->w,
            dstrect->h,
            UAV_PIX_FMT,
            SWS_FAST_BILINEAR,
            NULL,
            NULL,
            NULL
        );

        if( sws_context == NULL ) {
            warn( "Could not get SWS context\n" );
{'fraction_non_alphanumeric': 0.11259338313767342, 'fraction_numerical': 0.0032017075773745998, 'mean_word_length': 1.9667721518987342, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5599351', 'n_tokens_mistral': 681, 'n_tokens_neox': 652, 'n_words': 139}