Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (44)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (3134)

  • Rust Win32 FFI : User-mode data execution prevention (DEP) violation

    28 avril 2022, par TheElix

    I'm trying to pass a ID3D11Device instance from Rust to a C FFI Library (FFMPEG).

    


    I made this sample code :

    


    pub fn create_d3d11_device(&amp;mut self, device: &amp;mut Box, context: &amp;mut Box) {&#xA;            let av_device : Box<avbufferref> = self.alloc(HwDeviceType::D3d11va);&#xA;            unsafe {&#xA;                let device_context = Box::from_raw(av_device.data as *mut AVHWDeviceContext);&#xA;                let mut d3d11_device_context = Box::from_raw(device_context.hwctx as *mut AVD3D11VADeviceContext);&#xA;                d3d11_device_context.device = device.as_mut() as *mut _;&#xA;                d3d11_device_context.device_context = context.as_mut() as *mut _;&#xA;                let avp = Box::into_raw(av_device);&#xA;                av_hwdevice_ctx_init(avp);&#xA;                self.av_hwdevice = Some(Box::from_raw(avp));&#xA;            }&#xA;        }&#xA;</avbufferref>

    &#xA;

    On the Rust side the Device does work, but on the C side, when FFMEPG calls ID3D11DeviceContext_QueryInterface the app crashes with the following error : Exception 0xc0000005 encountered at address 0x7ff9fb99ad38: User-mode data execution prevention (DEP) violation at location 0x7ff9fb99ad38

    &#xA;

    The address is actually the pointer for the lpVtbl of QueryInterface, like seen here :

    &#xA;

    The disassembly of the address also looks correct (this is done on an another debugging session) :

    &#xA;

    (lldb) disassemble --start-address 0x00007ffffdf3ad38&#xA;    0x7ffffdf3ad38: addb   %ah, 0x7ffffd(%rdi,%riz,8)&#xA;    0x7ffffdf3ad3f: addb   %al, (%rax)&#xA;    0x7ffffdf3ad41: movabsl -0x591fffff80000219, %eax&#xA;    0x7ffffdf3ad4a: outl   %eax, $0xfd&#xA;

    &#xA;

    Do you have any pointer to debug this further ?

    &#xA;

    EDIT : I made a Minimal Reproducion Sample. Interestingly this does not causes a DEP Violation, but simply a Segfault.

    &#xA;

    On the C side :

    &#xA;

    int test_ffi(ID3D11Device *device){&#xA;    ID3D11DeviceContext *context;&#xA;    device->lpVtbl->GetImmediateContext(device, &amp;context);&#xA;    if (!context) return 1;&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    On the Rust side :

    &#xA;

    unsafe fn main_rust(){&#xA;    let mut device = None;&#xA;    let mut device_context = None;&#xA;    let _ = match windows::Win32::Graphics::Direct3D11::D3D11CreateDevice(None, D3D_DRIVER_TYPE_HARDWARE, OtherHinstance::default(), D3D11_CREATE_DEVICE_DEBUG, &amp;[], D3D11_SDK_VERSION, &amp;mut device, std::ptr::null_mut(), &amp;mut device_context) {&#xA;        Ok(e) => e,&#xA;        Err(e) => panic!("Creation Failed: {}", e)&#xA;    };&#xA;    let mut device = match device {&#xA;        Some(e) => e,&#xA;        None => panic!("Creation Failed2")&#xA;    };&#xA;    let mut f2 : ID3D11Device = transmute_copy(&amp;device); //Transmuting the WinAPI into a bindgen ID3D11Device&#xA;    test_ffi(&amp;mut f2);&#xA;}&#xA;

    &#xA;

    The bindgen build.rs :

    &#xA;

    extern crate bindgen;&#xA;&#xA;use std::env;&#xA;use std::path::PathBuf;&#xA;&#xA;fn main() {&#xA;    // Tell cargo to tell rustc to link the system bzip2&#xA;    // shared library.&#xA;    println!("cargo:rustc-link-lib=ffi_demoLIB");&#xA;    println!("cargo:rustc-link-lib=d3d11");&#xA;&#xA;    // Tell cargo to invalidate the built crate whenever the wrapper changes&#xA;    println!("cargo:rerun-if-changed=library.h");&#xA;&#xA;    // The bindgen::Builder is the main entry point&#xA;    // to bindgen, and lets you build up options for&#xA;    // the resulting bindings.&#xA;    let bindings = bindgen::Builder::default()&#xA;        // The input header we would like to generate&#xA;        // bindings for.&#xA;        .header("library.h")&#xA;        // Tell cargo to invalidate the built crate whenever any of the&#xA;        // included header files changed.&#xA;        .parse_callbacks(Box::new(bindgen::CargoCallbacks))&#xA;        .blacklist_type("_IMAGE_TLS_DIRECTORY64")&#xA;        .blacklist_type("IMAGE_TLS_DIRECTORY64")&#xA;        .blacklist_type("PIMAGE_TLS_DIRECTORY64")&#xA;        .blacklist_type("IMAGE_TLS_DIRECTORY")&#xA;        .blacklist_type("PIMAGE_TLS_DIRECTORY")&#xA;        // Finish the builder and generate the bindings.&#xA;        .generate()&#xA;        // Unwrap the Result and panic on failure.&#xA;        .expect("Unable to generate bindings");&#xA;&#xA;    // Write the bindings to the $OUT_DIR/bindings.rs file.&#xA;    let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());&#xA;    bindings&#xA;        .write_to_file(out_path.join("bindings.rs"))&#xA;        .expect("Couldn&#x27;t write bindings!");&#xA;}&#xA;

    &#xA;

    The Complete Repo can be found over here : https://github.com/TheElixZammuto/demo-ffi

    &#xA;

  • Revision 30966 : eviter le moche ’doctype_ecrire’ lors de l’upgrade

    17 août 2009, par fil@… — Log

    eviter le moche ’doctype_ecrire’ lors de l’upgrade

  • Revision 33458 : retablir le pied de la dist

    1er décembre 2009, par cedric@… — Log

    retablir le pied de la dist