From e1d19e306d76fb01e07d300105e52f1a3390a15f Mon Sep 17 00:00:00 2001 From: Tae-Young Chung Date: Tue, 1 Sep 2015 13:55:15 +0900 Subject: [PATCH] [mediavision] Update tutorial and guide (ACR-390) Change-Id: Ifff2144faa7983b1561e4a7e4ca54eb0bdbf7e85 Signed-off-by: Tae-Young Chung --- .../html/native/multimedia/media_vision_n.htm | 21 ++++++----- .../native/multimedia/media_vision_tutorial_n.htm | 43 +++++++++++++++++----- 2 files changed, 46 insertions(+), 18 deletions(-) diff --git a/org.tizen.guides/html/native/multimedia/media_vision_n.htm b/org.tizen.guides/html/native/multimedia/media_vision_n.htm index cbd8ba3..0d8c846 100644 --- a/org.tizen.guides/html/native/multimedia/media_vision_n.htm +++ b/org.tizen.guides/html/native/multimedia/media_vision_n.htm @@ -42,14 +42,8 @@
  • Detecting barcodes

    You can detect barcodes in an image or from camera preview streams, and then decrypt them to display messages to the user.

    -

    Before detecting a barcode, you must define the following detection attributes:

    +

    Before detecting a barcode, you must define the following detection attribute:

      -
    • Barcode detection mode: -
        -
      • Still image
      • -
      • Continuous images (video)
      • -
      -
    • Barcode detection target:
      • Detect both 1D and 2D barcodes
      • @@ -62,7 +56,16 @@
      • Generating barcodes

        You can encrypt a given message, generate a barcode from it, and save it in a memory or as a file.

        Define the barcode type:

        -

        Before generating a barcode, you must define the following generation specifications:

        +

        Before generating a barcode, you must define the following generation attribute:

        +
          +
        • Barcode generation text: +
            +
          • Generate barcode without input message
          • +
          • Generate barcode with input message (Support only 1D barcodes)
          • +
          +
        • +
        +

        and specifications:

        • Barcode type
        • QR code specification (if the QA code barcode type is used)
        • @@ -204,4 +207,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + diff --git a/org.tizen.tutorials/html/native/multimedia/media_vision_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/media_vision_tutorial_n.htm index 0a06903..c2e109f 100644 --- a/org.tizen.tutorials/html/native/multimedia/media_vision_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/media_vision_tutorial_n.htm @@ -62,7 +62,9 @@ #include <mv_barcode.h> -
        • For barcode generation, create a structure to store the global data with the bargendata_s structure: +
        • For barcode generation: +
            +
          1. Create a structure to store the global data with the bargendata_s structure:
             typedef struct _bargendata_s
             {
            @@ -78,12 +80,27 @@ typedef struct _bargendata_s
                mv_barcode_image_format_e image_format;
             
                mv_source_h g_source;
            +   mv_engine_config_h g_engine_cfg;
             } bargendata_s;
             
             static bargendata_s bargendata;
             
          2. +
          3. Configure the barcode generation engine with the mv_create_engine_config() function. The function configures an engine attribute with default values: + +
            • The MV_BARCODE_GENERATE_ATTR_TEXT attribute defines the generation with text using the mv_barcode_generate_attr_text_e enumerator (in mobile and wearable applications). The default value is MV_BARCODE_GENERATE_ATTR_TEXT_INVISIBLE.
            + +
            +int error_code = 0;
             
            +error_code = mv_create_engine_config(&bargendata.g_engine_cfg);
            +if (error_code != MEDIA_VISION_ERROR_NONE)
            +{
            +   dlog_print(DLOG_ERROR, LOG_TAG, "error code = %d", error_code);
            +}
            +
            +
          4. +
        • For barcode detection:
            @@ -118,22 +135,21 @@ static bardetdata_s bardetdata;
             int error_code = 0;
             
            -error_code = mv_create_source(&bardetdata.&g_source);
            +error_code = mv_create_source(&bardetdata.g_source);
             if (error_code != MEDIA_VISION_ERROR_NONE)
             {
                dlog_print(DLOG_ERROR, LOG_TAG, "error code = %d", error_code);
             }
             
            -
          1. Configure the barcode detection engine with the mv_create_engine_config() function. The function configures 2 engine attributes with default values: +
          2. Configure the barcode detection engine with the mv_create_engine_config() function. The function configures an engine attribute with default values: -
            • The MV_BARCODE_DETECT_ATTR_MODE attribute defines the detection mode using the mv_barcode_detect_attr_mode_e enumerator (in mobile and wearable applications). The default value is MV_BARCODE_DETECT_ATTR_MODE_VIDEO.
            • -
            • The MV_BARCODE_DETECT_ATTR_TARGET attribute defines the detection target using the mv_barcode_detect_attr_target_e enumerator (in mobile and wearable applications). The default value is MV_BARCODE_DETECT_ATTR_TARGET_ALL.
            +
            • The MV_BARCODE_DETECT_ATTR_TARGET attribute defines the detection target using the mv_barcode_detect_attr_target_e enumerator (in mobile and wearable applications). The default value is MV_BARCODE_DETECT_ATTR_TARGET_ALL.
             int error_code = 0;
             
            -error_code = mv_create_engine_config(&bardetdata.&g_engine_cfg);
            +error_code = mv_create_engine_config(&bardetdata.g_engine_cfg);
             if (error_code != MEDIA_VISION_ERROR_NONE)
             {
                dlog_print(DLOG_ERROR, LOG_TAG, "error code = %d", error_code);
            @@ -216,8 +232,8 @@ if (error_code != MEDIA_VISION_ERROR_NONE)
             
          3. Generate the barcode using the mv_barcode_generate_source() function:
            -error_code = mv_barcode_generate_source(NULL, "MediaVision-Tutorial-QRcode", bargendata.type, 
            -                                        bargendata.mode, bargendata.ecc, bargendata.version, bargendata .g_source);
            +error_code = mv_barcode_generate_source(bargendata.g_engine_cfg, "MediaVision-Tutorial-QRcode", bargendata.type, 
            +                                        bargendata.mode, bargendata.ecc, bargendata.version, bargendata.g_source);
             
             if (error_code != MEDIA_VISION_ERROR_NONE)
             {
            @@ -282,7 +298,7 @@ bargendata.image_format = MV_BARCODE_IMAGE_FORMAT_PNG;
             
          4. Generate the barcode using the mv_barcode_generate_image() function.

            In the following example, the generated file is saved in the /opt/usr/media directory with the file name mv_barcode_qrcode.png.

            -error_code = mv_barcode_generate_image(NULL, "MediaVision-Tutorial-QRcode", 
            +error_code = mv_barcode_generate_image(bargendata.g_engine_cfg, "MediaVision-Tutorial-QRcode", 
                                                    bargendata.width, bargendata.height, bargendata.type, 
                                                    bargendata.mode, bargendata.ecc, bargendata.version,
                                                    "/opt/usr/media/mv_barcode_qrcode.png", bargendata.image_format);
            @@ -296,6 +312,15 @@ if (error_code != MEDIA_VISION_ERROR_NONE)
             
        +
      • To release the g_engine_cfg handle, use the mv_destroy_engine_config() function: +
        +error_code = mv_destroy_engine_cfg(bargendata.g_engine_cfg);
        +if (error_code != MEDIA_VISION_ERROR_NONE)
        +{
        +   dlog_print(DLOG_ERROR, LOG_TAG, "error code = %d", error_code);
        +}
        +
        +
      • -- 2.7.4