From: Junkyeong Kim Date: Mon, 11 May 2015 09:22:34 +0000 (+0900) Subject: [tizen2.4][ACR-66][EOM] Init eom document X-Git-Tag: tizen_3.0/TD_SYNC/20161201~846^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=186edacb6082aaefa5a541a020c339e469361b06;p=sdk%2Fonline-doc.git [tizen2.4][ACR-66][EOM] Init eom document Change-Id: Idc7928f9dd27ee0826ba475181456e7ec7898064 Signed-off-by: Junkyeong Kim --- diff --git a/org.tizen.guides/html/images/eom_mode.png b/org.tizen.guides/html/images/eom_mode.png new file mode 100755 index 0000000..1e7b9eb Binary files /dev/null and b/org.tizen.guides/html/images/eom_mode.png differ diff --git a/org.tizen.guides/html/native/ui/eom_n.htm b/org.tizen.guides/html/native/ui/eom_n.htm new file mode 100644 index 0000000..7b27bec --- /dev/null +++ b/org.tizen.guides/html/native/ui/eom_n.htm @@ -0,0 +1,218 @@ + + + + + + + + + + + + + External Output Manager (EOM) + + + + + +
+ +

External Output Manager (EOM)

+

External Output Manager(EOM) is a module to control external output devices.

+

Until Tizen 2.3, Devicemgr(private module) is used for external output. But Devicemgr has some problems.

+

      - Devicemgr problems

+

      1. Cannot know video-only mode start and stop.

+

      2. Doesn't have method to notify to application about external output informations.

+

      3. Application cannot display specific images to external output.)

+

So module for external output is replaced to EOM from Tizen 2.4. EOM fixes devicemgr's problems and manages all convergence scenarios of external output.

+

EOM is a module of enlightenment. And EOM has X and Walyland backend.

+ +

Mode

+

EOM has two modes. One is Mirror mode, the other is Presentation mode.

+
+      

Figure: EOM mode

+

Window layers

+
+

Mirror mode is default mode. So if any application doesn't set presentation mode, Mirror mode will work by EOM module when external output device is connected.

+

Presentation mode can be set by application. If application wants to display it's own image or video to external output device, application must use presentation mode.

+ +

Attribute for Presentation Mode

+

Applications have to use EOM attributes to set presentation mode.

+

There are three priorities of EOM attribute. The meaning of set attribute is the application wants to display a window with fullscreen size on the external output.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Table: Attribute for presentation mode +
AttributeDescription
EOM_OUTPUT_ATTRIBUTE_NORMALCan set normal if none(mirror mode) or normal attribute state
Cannot set normal if exclusive_share or exclusive attribute state
EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE_SHARECan set exclusive_share if none(mirror mode), normal or exclusive_share attribute state
Cannot set exclusive_share if exclusive attribute set state
EOM_OUTPUT_ATTRIBUTE_EXCLUSIVECan set exclusive if none(mirror mode), normal or exclusive_share attribute state
Cannot set exclusive if exclusive attribute set state
+ +

Notify to application

+

EOM can send notification event to application. Eom checks several changes(external output add and remove, mode change, attribute state change) and sends notification events to EOM client.

+

So application(EOM client) can get the status of external output. EOM client has to register callback functions to get information.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Table: EOM Notify event +
Callback TypeDescriptionFunction
eom_output_add_cbSend event when the external output is connectedeom_set_output_added_cb, eom_unset_output_added_cb
eom_output_remove_cbSend event when the external output is disconnectedeom_set_output_removed_cb, eom_unset_output_removed_cb
eom_mode_change_cbSend event when the EOM output mode is changedeom_set_mode_changed_cb, eom_unset_mode_changed_cb
eom_attribute_change_cbSend event when the state of the EOM output attribute is changedeom_set_attribute_changed_cb, eom_unset_attribute_changed_cb
+ +

Get Information of External Output Device

+

By using below APIs, application can get information of external output device from EOM.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Table: APIs for get external output device information +
FunctionDescription
eom_get_eom_output_idsGets the ID of external output devices
eom_get_output_typeGets the connection type of external output (HDMI, Virtual, VGA, etc)
eom_get_output_modeGets the mode of external output (NONE, MIRROR, PRESENTATION)
eom_get_output_attributeGets the attribute information (NORMAL, EXCLUSIVE_SHARE, EXCLUSIVE)
eom_get_output_attribute_stateGets the attribute state information (NONE, ACTIVE, INACTIVE, LOST)
eom_get_output_resolutionGets the best resolution of external output device
eom_get_output_physical_sizeGets the physical size of external output device
+ +

Set to External Output Device

+

By using below APIs, application can set information to EOM.

+ + + + + + + + + + + + + + + + +
+ Table: APIs for set information +
FunctionDescription
eom_set_output_attributeSets to presentation mode by setting attribute to EOM
eom_set_output_windowSets window to the external output best resolution of external output device
+ + + +
+ +Go to top + + + + + + + diff --git a/org.tizen.guides/html/native/ui/ui_guide_n.htm b/org.tizen.guides/html/native/ui/ui_guide_n.htm index 444c0c9..47c3f6c 100644 --- a/org.tizen.guides/html/native/ui/ui_guide_n.htm +++ b/org.tizen.guides/html/native/ui/ui_guide_n.htm @@ -45,6 +45,7 @@
  • Font Setting

    Enables you to change the font of your application to another system default font or your own font.

  • EFL UTIL

    Enables you to manage notification window levels.

  • Multiple Screen Support

    Enables you to design applications for different kids of screens.

  • +
  • EOM

    Enables you to handle external output.

  • @@ -70,4 +71,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/ui/eom_tutorial_n.htm b/org.tizen.tutorials/html/native/ui/eom_tutorial_n.htm new file mode 100644 index 0000000..7da8970 --- /dev/null +++ b/org.tizen.tutorials/html/native/ui/eom_tutorial_n.htm @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + EOM: Using the External Output Devices + + + + + + +
    +

    EOM: Using the External Output Devices

    +
    +

    This tutorial demonstrates how you can control external output devices by EOM API.

    + +

    Warm-up

    +

    Become familiar with the EOM API basics by learning about:

    + + + +
    + +
    + +
      +
    • +
      +

      Initializing EOM

      + Hide +
      +
      +

      To use the EOM API, the following header file has to be included:

      +
      #include <eom.h>
      +

      And have to excute eom_init() function.

      +
      +
    • + +
    • +
      +

      Getting Output ID

      + Hide +
      +
      +

      Have to find output id to get information of output device and control external window.

      +

      Use the eom_get_eom_output_ids() function to find output id.

      +
      +int sample_get_output_id (const char *output_name)
      +{
      +   eom_output_id *output_ids = NULL;
      +   eom_output_id output_id = 0;
      +   eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN;
      +   int id_cnt = 0;
      +   int i;
      +   
      +   output_ids = eom_get_eom_output_ids(&id_cnt);
      +   if (id_cnt == 0)
      +   {
      +      printf ("no external outuputs supported\n");
      +      return 0;
      +   }
      +   
      +   for (i = 0; i < id_cnt; i++)
      +   {
      +      eom_get_output_type(output_ids[i], &output_type);
      +      if (!strncmp(output_name, "HDMI", 4))
      +      {
      +         if (output_type == EOM_OUTPUT_TYPE_HDMIA || output_type == EOM_OUTPUT_TYPE_HDMIB)
      +         {
      +            output_id = output_ids[i];
      +            break;
      +         }
      +      }
      +      else if (!strncmp(output_name, "Virtual", 7))
      +      {
      +         if (output_type == EOM_OUTPUT_TYPE_VIRTUAL)
      +         {
      +            output_id = output_ids[i];
      +            break;
      +         }
      +      }
      +   }
      +   
      +   if (output_ids)
      +      free (output_ids);
      +   return output_id;
      +}
      +      
      +
      +
    • + +
    • +
      +

      Setting Attribute

      + Hide +
      +
      +

      To acquire the right of external output device, use the eom_set_output_attribute() function

      +

      If setting is successful, eom module will work presentation mode when external output device connected.

      +
      +int set_attribute()
      +{
      +   m_output_id output_id = 0;
      +   int ret;
      +   
      +   output_id = sample_get_output_id("HDMI");
      +   
      +   ret = eom_set_output_attribute(output_id, EOM_OUTPUT_ATTRIBUTE_NORMAL);
      +   if (ret != EOM_ERROR_NONE) 
      +   {
      +      //Attribute set fail. Cannot use external output device. Deinitializing.
      +      eom_deinit ();
      +      return -1;
      +   }
      +   return 0;
      +}
      +    
      +

      There are three attributes for priority. It is recommended to use EOM_OUTPUT_ATTRIBUTE_NORMAL attribute to general application.

      +

      Other attributes are for special applications.

      +
      +EOM_OUTPUT_ATTRIBUTE_NORMAL
      +EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE_SHARE
      +EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE
      +    
      +

      If receive EOM_ERROR_NONE by eom_set_output_attribute() funtion, the application can use external output device.

      +
      +
    • + +
        +
      • +
        +

        Setting External Window

        + Hide +
        +
        +

        Application can set window to external by using eom_set_output_window() function.

        +

        This API moves window to external output and resizes best resolution of external output device automatically.

        +

        Before excuting this function, application must receive success return from eom_set_output_attribute() function.

        +
        +int make_external_window()
        +{
        +   Evas_Object *window;
        +   window = elm_win_add(NULL, "external_window", ELM_WIN_BASIC);
        +   if (eom_set_output_window(output_id, window) == EOM_ERROR_NONE)
        +      return 0;
        +   else
        +   {
        +      evas_object_del (window);
        +      return -1;
        +   }
        +}
        +      
        +
        +
      • + +
      • +
        +

        Getting Status of External Output Device

        + Hide +
        +
        +

        Application can get external output device's information by using EOM API callback functions.

        +

        mode info

        +

        Mirror mode is default mode. If eom_set_output_attribute funtion excuted successfully, the external output will work to presentation mode.

        +
        +typedef enum
        +{
        +   EOM_OUTPUT_MODE_NONE,
        +   EOM_OUTPUT_MODE_MIRROR,
        +   EOM_OUTPUT_MODE_PRESENTATION,
        +   EOM_OUTPUT_MODE_MAX,
        +} eom_output_mode_e;
        +        
        + +

        attribute state

        +

        If application set attribue, EOM send current attribute state to application.

        +

        ACTIVE means application can use external output. INACTIVE means cannot use cause of disconnection.

        +

        LOST means application cannot use external output cause of another application's attribute setting.

        +

        In case of LOST, application can't recevie attribute state anymore.

        +
        +typedef enum
        +{
        +   EOM_OUTPUT_ATTRIBUTE_STATE_NONE,
        +   EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE,
        +   EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE,
        +   EOM_OUTPUT_ATTRIBUTE_STATE_LOST,
        +   EOM_OUTPUT_ATTRIBUTE_STATE_MAX,
        +} eom_output_attribute_state_e;
        +        
        + +

        get information

        +

        Application can get some information by using below APIs.

        +

        int eom_get_output_type (eom_output_id output_id, eom_output_type_e *type):Get output device type(HDMI, VIRTUAL, VGA, etc).

        +

        int eom_get_output_mode (eom_output_id output_id, eom_output_mode_e *mode):Get mode (NONE, MIRROR, PRESETNTATION).

        +

        int eom_get_output_attribute (eom_output_id output_id, eom_output_attribute_e *attribute)Get information of attribute set(NORMAL, EXCLUSIVE_SHARE, EXCLUSIVE).

        +

        int eom_get_output_attribute_state (eom_output_id output_id, eom_output_attribute_state_e *state)Get attribute state(ACTIVE, INACTIVE, LOST).

        +

        int eom_get_output_resolution (eom_output_id output_id, int *width, int *height)Get best resolution of external output device.

        +

        int eom_get_output_physical_size (eom_output_id output_id, int *phy_width, int *phy_height)Get physical size of external output device.

        + +

        callback

        +

        Application can get status changing event by setting callback functions.

        +
        +typedef void (*eom_output_added_cb)(eom_output_id output_id, void *user_data);
        +typedef void (*eom_output_removed_cb)(eom_output_id output_id, void *user_data);
        +typedef void (*eom_mode_changed_cb)(eom_output_id output_id, void *user_data);
        +typedef void (*eom_attribute_changed_cb)(eom_output_id output_id, void *user_data);
        +        
        +

        By using below funtions, application can set and unset callback functions.

        +
        +int eom_set_output_added_cb (eom_output_added_cb callback, void *user_data);            //external output connection event
        +int eom_unset_output_added_cb (eom_output_added_cb callback);                           //external output connection event
        +int eom_set_output_removed_cb (eom_output_removed_cb callback, void *user_data);        //external output disconnection event
        +int eom_unset_output_removed_cb (eom_output_removed_cb callback);                       //external output disconnection event
        +int eom_set_mode_changed_cb (eom_mode_changed_cb callback, void *user_data);            //external output mode changing event
        +int eom_unset_mode_changed_cb (eom_mode_changed_cb callback);                           //external output mode changing event
        +int eom_set_attribute_changed_cb (eom_attribute_changed_cb callback, void *user_data);  //external output attribute state changing event
        +int eom_unset_attribute_changed_cb (eom_attribute_changed_cb callback);                 //external output attribute state changing event
        +        
        +

        This is sample code about callback funtion.

        +
        +typedef struct
        +{
        +   Evas_Object *external_window;
        +   int output_id;
        +} SampleInfo;
        +
        +static void
        +sample_notify_cb_output_add (eom_output_id output_id, void *user_data)
        +{
        +   SampleInfo *info = (SampleInfo*)user_data;
        +   if (!info->external_window)
        +   {
        +      //make external window
        +      make_external_window(info->external_window);
        +   }
        +}
        +
        +static void
        +sample_notify_cb_output_remove (eom_output_id output_id, void *user_data)
        +{
        +   SampleInfo *info = (SampleInfo*)user_data;
        +   if (!info->external_window)
        +   {
        +      evas_object_del (info->external_window)
        +      info->external_window = NULL;
        +   }
        +}
        +
        +static void
        +sample_notify_cb_attribute_changed (eom_output_id output_id, void *user_data)
        +{
        +   SampleInfo *info = (SampleInfo*)user_data;
        +   eom_output_attribute_e attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
        +   eom_output_attribute_state_e state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
        +   
        +   eom_get_output_attribute(output_id, &attribute);
        +   eom_get_output_attribute_satate(output_id, &state);
        +   
        +   if (state == EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE)
        +   {
        +      //start displaying image to external output(info->external_window);
        +   }
        +   else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE)
        +   {
        +      //stop displaying image
        +      //destory external_window
        +      if (info->external_window)
        +      {
        +         evas_object_del (info->external_window);
        +         info->external_window = NULL;
        +      }
        +   }
        +   else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_LOST)
        +   {
        +      //stop displaying image
        +      //destory external_window
        +      if (info->external_window)
        +      {
        +         evas_object_del (info->external_window);
        +         info->external_window = NULL;
        +      }
        +      //remove callback
        +      eom_unset_output_added_cb(sample_notify_cb_output_add);
        +      eom_unset_output_removed_cb(sample_notify_cb_output_remove);
        +      eom_unset_attribute_changed_cb(sample_notify_cb_attribute_changed);
        +      eom_deinit ();
        +   }
        +}
        +
        +int elm_main()
        +{
        +   SampleInfo *info;
        +   eom_output_mode_e output_mode = EOM_OUTPUT_MODE_NONE;
        +   int ret;
        +   
        +   info = calloc(sizeof(SampleInfo));
        +   
        +   eom_init ();
        +   info->output_id = sample_get_output_id ("HDMI");
        +   
        +   ret = eom_set_output_attribute(info->hdmi_output_id, EOM_OUTPUT_ATTRIBUTE_NORMAL);
        +   if (ret != EOM_ERROR_NONE)
        +   {
        +      //cannot use external output device
        +      eom_deinit ();
        +   }
        +   else
        +   {
        +      eom_get_output_mode(info->output_id, &output_mode);
        +      if (output_mode != EOM_OUTPUT_MODE_NONE)
        +      {
        +         //make external window
        +         make_external_window(info->external_window);
        +      }
        +      
        +      //add callback
        +      eom_set_output_added_cb(sample_notify_cb_output_add, info);
        +      eom_set_output_removed_cb(sample_notify_cb_output_remove, info);
        +      eom_set_attribute_changed_cb(sample_notify_cb_attribute_changed, info);
        +   }
        +   
        +   elm_run();
        +   
        +   //remove callback
        +   eom_unset_output_added_cb(sample_notify_cb_output_add);
        +   eom_unset_output_removed_cb(sample_notify_cb_output_remove);
        +   eom_unset_attribute_changed_cb(sample_notify_cb_attribute_changed);
        +   eom_deinit ();
        +   elm_shutdown();
        +   return 0;
        +}
        +        
        +
        +
      • +
      +
    +
    + + + + +
    + +Go to top + + + + + + + diff --git a/org.tizen.tutorials/html/native/ui/ui_tutorials_n.htm b/org.tizen.tutorials/html/native/ui/ui_tutorials_n.htm index 2ca6c78..d330718 100644 --- a/org.tizen.tutorials/html/native/ui/ui_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/ui/ui_tutorials_n.htm @@ -42,7 +42,7 @@
  • Font Setting: Using Various Fonts in the Application

    Demonstrates how you can modify the fonts and text size of your application, or set your own font.

  • EFL UTIL: Adjusting the Notification Window Level

    Demonstrates how you can create a notification window and adjust its position.

  • EFL Optimization: Optimizing Tizen Native Applications

    Demonstrates how you can optimize your Tizen native application.

  • - +
  • EOM: Using External Output by EOM

    Demonstrates how you can use external output devices.