
{"id":10044,"date":"2022-06-21T09:10:43","date_gmt":"2022-06-21T09:10:43","guid":{"rendered":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/documentation\/rdk_video_documentation\/components\/open-sourced_components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/"},"modified":"2025-03-25T05:18:34","modified_gmt":"2025-03-25T05:18:34","slug":"aamp_dash_architecture_overview","status":"publish","type":"page","link":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/","title":{"rendered":"AAMP DASH Architecture Overview"},"content":{"rendered":"<p><!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\"><br \/>\n <html><body><\/p>\n<h3 id=\"AAMPDASHArchitectureOverview-DASHDRMFlow(analogoustoMSE\/EME)\">DASH DRM Flow (analogous to MSE\/EME)<\/h3>\n<p><strong>1. PrivateStreamAbstractionMPD::ProcessContentProtection<\/strong><\/p>\n<ul>\n<li>Checks if PSSH is available in manifest and, initiates DRM session creation, if PSSH is available.<\/li>\n<li>This will be the starting point for DRM session creation, if PSSH is available in manifest.<\/li>\n<li>Also Queue Protection Event using the extracted PSSH, for the cases where PSSH is missing in stream.<\/li>\n<li>This protection event is published to gstreamer layer from AMPGstPlayer_SendPendingEvents\n<ul>\n<li><strong style=\"letter-spacing: 0.0px;\">1.A)<\/strong><span>&nbsp;<\/span><span>If yes extracts the PSSH and metadata for available DRM systems<\/span><\/li>\n<li><strong style=\"letter-spacing: 0.0px;\">1.B)&nbsp;<\/strong><span>If multiple DRMs are present selects the preferred one<\/span><\/li>\n<li><strong style=\"letter-spacing: 0.0px;\">1.C)&nbsp;<\/strong><span>If lastProcessedKeyID != newKeyID<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Spawns thread to create DRM session for that keyID<\/p>\n<p><\/p>\n<p><strong>2. AampDRMSessionManager::createDrmSession<\/strong><\/p>\n<ul>\n<li>CreateDrmSession, creates and\/or returns the decrypt context by calling DRM API&#8217;s through OpenCDMSession<\/li>\n<li>We have two slots for DRM sessions, if the new request matches none of the already processed keyIDs, clears the oldest one.\n<ul>\n<li><strong>2.A)<\/strong><span>&nbsp;<\/span>Returns drm context to decrypt if a session is present with requested keyID<\/li>\n<li><strong>2.B)<\/strong><span>&nbsp;<\/span>Else, creates new drm session and stores the keyID to keyID cache.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>&nbsp;&nbsp; AampDrmSessionFactory::GetDrmSession(systemId);<\/strong><\/p>\n<ul>\n<li>Initializes and returns appropriate DrmSession ie, PlayReady or WideWine<\/li>\n<li>drm session state will be KEY_INIT on success<\/li>\n<\/ul>\n<p>&nbsp;&nbsp;<span>&nbsp;<\/span><strong>drmSession-&gt;generateAampDRMSession(initDataPtr, dataLength);<\/strong><\/p>\n<ul>\n<li>Binds the initdata with the initialized drm session<\/li>\n<li>drm session state will be KEY_INIT on success<\/li>\n<\/ul>\n<p><strong>&nbsp;&nbsp;&nbsp; drmSession-&gt;aampGenerateKeyRequest(destinationURL);<\/strong><\/p>\n<ul>\n<li>&nbsp;Generates license request from the drm session<\/li>\n<li>drm session state will be KEY_PENDING on success<\/li>\n<\/ul>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p>&nbsp;&nbsp;&nbsp;<span>&nbsp;<\/span><strong>SecClient_AcquireLicense(&#8230;.);&nbsp;&nbsp;&nbsp;&nbsp; OR&nbsp; AampDRMSessionManager&#8217;s getLicense()<\/strong><\/p>\n<ul>\n<li>Gets the license key by posting a proper request to license server, created<\/li>\n<li>&nbsp;using KeyRequest, destinationURL, accessToken etc.<\/li>\n<\/ul>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p>&nbsp;&nbsp;&nbsp;<span>&nbsp;<\/span><strong>drmSession-&gt;aampDRMProcessKey(key);<\/strong><\/p>\n<ul>\n<li>Key returned from AcquireLicense is fed to drm.<\/li>\n<li>drm session state will be KEY_READY on success<\/li>\n<\/ul>\n<p><\/p>\n<p><strong>3. Handling GST_EVENT_PROTECTION in gst_aampcdmidecryptor_sink_event<\/strong><\/p>\n<ul>\n<li>In normal cases, where PSSH is present in both manifest and stream AAMP will initiate to create drm session from step 1 itself and drm session will be almost ready, when qtdemux publishes the GST_EVENT_PROTECTION&nbsp;<\/li>\n<li>In cases where PSSH is not in stream this will be the starting point of DRM session creation\n<ul>\n<li><strong style=\"letter-spacing: 0.0px;\">3.A)<\/strong><span>&nbsp;<\/span><span>Parse the initdata in PROTECTION_EVENT and request drm session.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong style=\"letter-spacing: 0.0px;\">4. qtdemux and playready\/widevine plugins.<\/strong><\/p>\n<ul>\n<li>AAMP playready\/widevine plugins are initialized with GST_RANK_PRIMARY<\/li>\n<li>This rank is changed to GST_RANK_PRIMARY + 111, on first AAMP tune.<\/li>\n<li>This is to make sure AAMP plugins are not interfering with WPE plugins<\/li>\n<\/ul>\n<p>&nbsp;&nbsp;&nbsp; 4.A) qtdemux detects stream encryption<\/p>\n<p>&nbsp;&nbsp;&nbsp; 4.B) qtdemux sends need context message for preferred-drm<\/p>\n<p>&nbsp;&nbsp;&nbsp; 4.C) bus_sync_handler in AAMPGstPlayer responds with preferred-drm<\/p>\n<p>&nbsp;&nbsp;&nbsp; 4.D) qtdemux sends protection event for preferred-drm<\/p>\n<p>&nbsp;&nbsp;&nbsp; 4.E) playready\/widevine plugins receives the protection event, only the preferred plugin process it and other one discards it.<\/p>\n<p>&nbsp;&nbsp;&nbsp; 4.F) gst_aampcdmidecryptor_transform_ip is invoked, where buffer is decrypted<\/p>\n<p>Below is the diagram showing MSE-EME&rsquo;s stack overview, we follow almost same flow in AAMP.<\/p>\n<p><a rel=\"nofollow\" href=\"https:\/\/www.w3.org\/TR\/encrypted-media\/stack_overview.svg\" class=\"external-link\">https:\/\/www.w3.org\/TR\/encrypted-media\/stack_overview.svg<\/a><\/p>\n<p><a rel=\"nofollow\" href=\"https:\/\/w3c.github.io\/encrypted-media\/format-registry\/stream\/mp4.html\" class=\"external-link\">https:\/\/w3c.github.io\/encrypted-media\/format-registry\/stream\/mp4.html<\/a><\/p>\n<p><a class=\"external-link\" href=\"https:\/\/w3c.github.io\/encrypted-media\/format-registry\/initdata\/cenc.html\" rel=\"nofollow\">https:\/\/w3c.github.io\/encrypted-media\/format-registry\/initdata\/cenc.html<\/a><\/p>\n<p><\/body><\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DASH DRM Flow (analogous to MSE\/EME) 1. PrivateStreamAbstractionMPD::ProcessContentProtection Checks if PSSH is available in manifest [&hellip;]<\/p>\n","protected":false},"author":28,"featured_media":0,"parent":10015,"menu_order":8,"comment_status":"open","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-10044","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AAMP DASH Architecture Overview - RDK Documentation Portal | Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AAMP DASH Architecture Overview - RDK Documentation Portal | Documentation\" \/>\n<meta property=\"og:description\" content=\"DASH DRM Flow (analogous to MSE\/EME) 1. PrivateStreamAbstractionMPD::ProcessContentProtection Checks if PSSH is available in manifest [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/\" \/>\n<meta property=\"og:site_name\" content=\"RDK Documentation Portal | Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-25T05:18:34+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/\",\"name\":\"AAMP DASH Architecture Overview - RDK Documentation Portal | Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\"},\"datePublished\":\"2022-06-21T09:10:43+00:00\",\"dateModified\":\"2025-03-25T05:18:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documentation\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"RDK Video\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Components\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Advanced Adaptive Media Player (AAMP)\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"AAMP DASH Architecture Overview\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/\",\"name\":\"RDK Documentation Portal | Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AAMP DASH Architecture Overview - RDK Documentation Portal | Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/","og_locale":"en_US","og_type":"article","og_title":"AAMP DASH Architecture Overview - RDK Documentation Portal | Documentation","og_description":"DASH DRM Flow (analogous to MSE\/EME) 1. PrivateStreamAbstractionMPD::ProcessContentProtection Checks if PSSH is available in manifest [&hellip;]","og_url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/","og_site_name":"RDK Documentation Portal | Documentation","article_modified_time":"2025-03-25T05:18:34+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/","url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/","name":"AAMP DASH Architecture Overview - RDK Documentation Portal | Documentation","isPartOf":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website"},"datePublished":"2022-06-21T09:10:43+00:00","dateModified":"2025-03-25T05:18:34+00:00","breadcrumb":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/aamp_dash_architecture_overview\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":2,"name":"Documentation","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":3,"name":"RDK Video","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/"},{"@type":"ListItem","position":4,"name":"Components","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/"},{"@type":"ListItem","position":5,"name":"Advanced Adaptive Media Player (AAMP)","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/advanced_adaptive_media_player_aamp\/"},{"@type":"ListItem","position":6,"name":"AAMP DASH Architecture Overview"}]},{"@type":"WebSite","@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website","url":"https:\/\/developer.rdkcentral.com\/documentation\/","name":"RDK Documentation Portal | Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/10044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/comments?post=10044"}],"version-history":[{"count":1,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/10044\/revisions"}],"predecessor-version":[{"id":10045,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/10044\/revisions\/10045"}],"up":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/10015"}],"wp:attachment":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/media?parent=10044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}