proprietary and confidential © 2008 motorola © 2008 motorola nvidia apx 2500 evaluation october...
TRANSCRIPT
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
NVIDIA APX 2500 EvaluationOctober 29, 2008
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
Overall Goals What we need to evaluate
• Understand the layers [OPENKODE, OPENGL ES, NVIDIA Helper Libraries, Launcher]
• MVC – manipulation of View, Control and Data - create a simple list example to read data from the database or txt file - extend the functionality of the list to add custom behaviors
• OPENGL ES - create simple demo using the NVIDIA framework
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
NVIDIA SDKParts and Pieces
All logic is written in C/C++ using NVIDIA Helper libraries and OpenKODE Core Libraries
Widgets
Flows
Data Sources
UI
OperatingSystem os os os
core experiences
Calendar
LocationDashboard
Connected Player
What’s playing
now
Converse thru
ContentMotoSocial
Smart Search
My Top5
Integrated Contacts
Contacts Detail View
core input (motokeys, mototouch)
native toolkit, applications + services
native toolkit, applications + services
native toolkit, applications + services
abstraction layer
Contacts GPS/presenceMultimediaTelephony Messaging
Applications &
Services
core presentation
core interactions + controls
Hardware h/w h/w h/w
NVIDIA Helper Libraries2D widgets
OpenKODE Core for file I/O or db connection
Application logic using OpenKODE Core/NVIDIA Helper libraries
OpenGL ES3D effects
Any UI framework that interfaces with OpenKODE can be used to handle 2D widgets and logic.
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
NVIDIA SDKProgramming environment
OPENKODE provides the basic C like functionality for event handling, variables, application initialization and cleanup etc.
Functionality prefixed by “KD”.
NVIDIA Helper Libraries provide a range of functionality from 2D UI framework, file input/output, OpenGL ES extensions. Functionality prefixed by “Nv”. OPENGL ES functions can be
directly called and are prefixed by “gl”
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
Manipulation of View/ControlList example
• NVIDEA UI framework handles the rendering of all visible screen elements including backgrounds, bars, buttons, characters, and strings.
• NvUIScrollPane, a subclass of the nv_ui library can be manipulated and manages the physics of gesture inputs, dragging/flicking, and touch-scrolling lists extending beyond the length of the screen.
• NvUIRect can be used to change the area size and orientation of the list
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
Custom FunctionalityTwo List example
• NVIDIA UI Framework limitations for displaying two list views in landscape•Able to identify code to draw the list•Duplicating code block and changing some of the size parameters allowed for 2 lists
• Issue1: Focus Control •Once focus is changed to 2nd list, unable to refocus on 1st list•Simple issue of not understanding how list gets focus
• Issue2: Two Lists/controls side-by-side •When rotating lists to landscape view, they overlap each other•Unable to identify parameter to start 2nd list at different x-axis position
•
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
Manipulation of DataList example – read from TXT file
NVIDIA core app (Address Book) enables reading from various file formats & displaying to a list
• Reading from Text file required altering NVIDIA code from “rb” read binary to “r” for text:fp = fopen(fileName, "r");
• Assign full path to data file and store it with project build char* fileName = "d:\\Profiles\\w0438c\\Desktop\\nvap_sdk_0_3_x\\demos\\src\\addrbook\\ES2\\names.txt";
• Track the record count in the file:contactDB = (NvContactRecord*)kdMalloc(
sizeof(NvContactRecord) * realNameCount);
• Account for data fields in file. Every ‘%s’ represents [i]fscanf(fp, "%s %s %s %s %s %s\n", contactDB[i].nameL, contactDB[i].nameF,
contactDB[i].telH, contactDB[i].telM, contactDB[i].telW, contactDB[i].email);
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
Reading from text file#elif READ_TEXT_CONTACTS { KDint i;
FILE *fp;char* fileName = "d:\\Profiles\\w0438c\\Desktop\\nvap_sdk_0_3_x\\demos\\src\\addrbook\\ES2\\names.txt";
try{ fp = fopen(fileName, "r");}catch (char * str){ nt dummy =0;}
fscanf(fp, "%d\n", &realNameCount); contactDB = (NvContactRecord*)kdMalloc( sizeof(NvContactRecord) * realNameCount);
// then strip data, and write back out immediately. for (i=0; i<realNameCount; i++) { memset(contactDB + i, 0, sizeof(NvContactRecord)); if (fp) { if (feof(fp)) { fclose(fp); fp = fopen("d:\\Profiles\\w0438c\\Desktop\\nvap_sdk_0_3_x\\demos\\src\\addrbook\\ES2\\names.txt", "r"); }
fscanf(fp, "%s %s %s %s %s %s\n", contactDB[i].nameL, contactDB[i].nameF, contactDB[i].telH, contactDB[i].telM,contactDB[i].telW,contactDB[i].email);
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
#include "stdafx.h"using namespace System;using namespace System::Data;using namespace System::Data::SqlClient;
//namespace test45
int main(int argc, char* argv[]){using namespace std;
int quit=0;while(quit != 1)
{
String^ strConnection = "Data Source=W0438C-05;Initial Catalog=Contacts;Integrated Security=True;Pooling=False";
SqlConnection^ myConnection = gcnew SqlConnection(strConnection); SqlDataAdapter^ adpProducts = gcnew SqlDataAdapter();//adpProducts->TableMappings->Add(S"Table", S"Products");
SqlCommand^ cmdProducts = gcnew SqlCommand("SELECT * FROM ContactRecord", myConnection);
adpProducts->SelectCommand = cmdProducts;DataSet^ ds = gcnew DataSet();adpProducts->Fill(ds);
int numRows = ds->Tables[0]->Rows->Count;int numItems = ds->Tables[0]->Rows[0]->ItemArray->Length;
for (int c=0; c<numRows; c++){for (int a=0; a<numItems; a++)
{//play with this line to get the data to displayConsole::Write(ds->Tables[0]->Rows[c]->ItemArray[a]);//Console::WriteLine(ds->Tables[0]->Rows[c]->ItemArray->Length );}
Console::WriteLine("");}cin >> quit;
}}
Console SQL project
Connection string:String^ strConnection = "Data Source=W0438C-05;Initial Catalog=Contacts;Integrated Security=True;Pooling=False";
Query:SqlCommand^ cmdProducts = gcnew SqlCommand("SELECT * FROM ContactRecord", myConnection);
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
OPENGL ES Example using NVIDIA Helper Libraries
• Start with basic triangle project from nVidia•By increasing the number of triangles, we were able to create a cube
• Shader provided didn’t allow for z-axis movement
Vertices to draw triangles from
Offset for each triangle
Color blending at each vertex
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
OPENGL Exploration
• Explore basic openGL concepts•Create pyramid and cubes
• Able to show depth•Able to rotate on x,y,and z axis
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
A Compositor GUI in the OpenKODE window manager system running applications as standalone windows or rendered as panes in a compositing 3D UI
• Assignment of NVIDEA core and custom applications to Launcher panes• Addition of custom apps to specific windows within the Launcher (using APP_ID)
Launcher 3 example applications
Launcher can be customized, and resized… but it’s primary function is window management
One-Line List Example: NVIDEA Core app
reading our text data
Two-Line List Example: NVIDEA Core app
reading our text data
Created our own custom Open GL ES app using the NVIDEA helper libraries and assigned it to a specific window in the Launcher
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
Launcher 3 example applications
Assign your custom application to a specific launcher pane. Apply an ID to your custom app which will be read by the launcher, and assigned to the appropriate position in the spinner…
All custom apps are defined as having an unknown APP_ID
Sets the APP_ID to the number specified in the launcher configuration file
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
Launcher 3 example applications
Add the appropriate path and AppID to the launcher config.txt file
Include relative path to your custom app location. Core nvidea apps are all stored in their own folder
Apply custom APP_ID to the appropriate panel position on the spinner
Proprietary and Confidential © 2008 MOTOROLA© 2008 MOTOROLA
Launcher 3 example applications
The launcher_def.h file is where all APP_ID numbers are reserved. Custom app ID’s need to be added…
Reserved ID’s for nvidea core apps.
Custom APP_ID’s start at 1024